python-egnyte icon indicating copy to clipboard operation
python-egnyte copied to clipboard

FileOrFolder.link documentation issues

Open acosand opened this issue 7 years ago • 4 comments

Comment for FileOrFolder.link says:

  • accessibility: Determines how the link can be accessed ('Anyone', 'Password', 'Domain', 'Recipients')"

but I've had to use 'anyone' and 'domain'. It also says that expiry_date and expiry_clicks are optional, but I was required to use one. (Ideally, both could be used, but that's probably not a python-egnyte issue).

acosand avatar Sep 15 '17 06:09 acosand

Hi @acosand,

You mean the capital letter: "Anyone" vs. "anyone"? If so, I can confirm that's a misprint, we'll update this comment.

As for expiration, you're probably having some configuration problems. Could you please log in to you Egnyte Connect and proceed to Settings -> Configuration -> General (you should have the admin user in order to do that)?

You should see something like

sharing

Check "Maximum file and folder link expiration" settings. If this options is enabled, expiration values become mandatory (we'll reflect this in documentation as well). Note that both cannot be used, you'll get 400 from the Public API. It's either date or number of clicks.

dsoloviov avatar Sep 15 '17 08:09 dsoloviov

Yes, I meant the capitalization. Thanks. WRT the expiration, I'm not an admin so I'm probably not going to be able to see those settings. I actually do want my links to expire, but when I was trying to get something working it just seemed like one more thing that wasn't working as documented. I understand that I can't currently use both, but ideally I would like to be able to provide a link which can only be used once, and must be used within an hour.
Thank you.

acosand avatar Sep 15 '17 16:09 acosand

I'm not an admin so I'm probably not going to be able to see those settings

Actually you should be able to get (but not set) those settings through Public API

curl -X GET https://<DOMAIN>.egnyte.com/pubapi/v1/links/settings -H 'authorization: Bearer <YOUR_TOKEN>'

will return something like:

{
    "expiration": {
        "default": {
            "value": 3,
            "unit": "week"
        },
        "max_allowed": {
            "expiry_time_value": 5,
            "expiry_time_unit": "months",
            "expiry_clicks": 6
        },
        "upload_links": true
    },
    "file_links": {
        "anyone": true,
        "password": true,
        "domain": true,
        "recipients": true,
        "default_type": "recipients"
    },
    "folder_links": {
        "anyone": true,
        "password": true,
        "domain": true,
        "recipients": true,
        "default_type": "anyone"
    }
}

Based on that you can easily calculate valid settings. Hope it helps!

dsoloviov avatar Sep 15 '17 16:09 dsoloviov

I would like to be able to provide a link which can only be used once, and must be used within an hour

Actually it makes sense. Let me check with engineers from the team responsible for Public API if it's on the roadmap.

dsoloviov avatar Sep 15 '17 16:09 dsoloviov