Forum Discussion

taro_suzuki1101's avatar
taro_suzuki1101
Explorer | Level 4
5 years ago

About list_shared_links

I'm using a Dropbox basic account and API v2.0.
Why do some files return a URL with / s / and some do not, even if I hit list_shared_links with a specific file path?
Also, what is the difference between "/ scl / fi" and "/ s /"?
Please tell me who knows.

4 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    The /2/sharing/list_shared_links endpoint will return existing shared links for files and folders in the connected account. Note that normal files don't have shared links created for them by default, so there won't be any returned for a file if one hasn't been explicitly created.

     

    Some special kinds of items though, such as cloud docs like Paper docs, may automatically have shared links.

     

    And different kinds of shared links have may have different components like you mentioned. For instance, "/s/" is used in shared links for individual normal files, and "/scl/fi" is used in shared links for some other kinds of items, such as cloud does like Paper docs.

  • taro_suzuki1101's avatar
    taro_suzuki1101
    Explorer | Level 4
    5 years ago

    Thank you for teaching me!
    I have an additional question.

    The return value of list_shared_links is
    Some files
    "Links": [{". Tag": "file", "url": "https://www.dropbox.com/s/~~~~~",]
    On the other hand
    "Links": [{". Tag": "folder", "url": "https://www.dropbox.com/sh/~"]
    There is a file that returns the folder information first. What is the difference?
    Is it possible that the file is restricted?
    I don't know the cause, so please let me know who knows.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    When supplying a particular path, the /2/sharing/list_shared_links endpoint "returns a list of all shared links that allow access to the given path - direct links to the given path and links to parent folders of the given path". So, if you call it for a specific file and see a folder link, that means that there's a shared link for a parent folder that enables access to that requested file. If you only want to links to the file itself, "Links to parent folders can be suppressed by setting direct_only to true".

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!