Forum Discussion

gembin's avatar
gembin
Explorer | Level 3
6 years ago

How to get all shared links in a folder?

For example if I have 5 files in folder /images,  how list all the shared links?  And I dont want to share the folder.

/images

   1.jpg

   2.jpg

    ...

   5.jpg

 

I tried https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_shared_links

 

curl -X POST https://api.dropboxapi.com/2/sharing/list_shared_links \
--header "Authorization: Bearer xxxx \
--header "Content-Type: application/json" \
--data "{ \"path\": \"/images\"}"

 

It cannot list all the shared links, it returns: 

 

{"links": [], "has_more": false}

 

 

Thanks!

 

 

6 Replies

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

    The Dropbox API unfortunately doesn't offer a way to retrieve all shared links for items inside a specific folder, but I'll pass this along as a feature request.

    Using /2/sharing/list_shared_links with a specific path only "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 you'd need to either:

    • call /2/sharing/list_shared_links once for each specific file, or
    • not specify a path, and then do the filtering client-side for items under that path
  • kuznetsovvl's avatar
    kuznetsovvl
    Explorer | Level 4
    4 years ago

    Hey! Does Dropbox API have any changes? I wanna get downloadable link of items inside folders, Is it possible to get it in one API request? Currently I'm using get_shared_link_metadata endpoint and it works really long for the big amount of records because i should make request for each item.

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

    kuznetsovvl No, unfortunately I don't have any changes to report for this feature request.

  • DoControl's avatar
    DoControl
    New member | Level 2
    4 years ago

    any changes or updated within the api to support listing the sharing links for a shared folder? 

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    4 years ago

    DoControl wrote:

    any changes or updated within the api to support listing the sharing links for a shared folder? 


    Hi DoControl,

    You are asking something different than the OP! Listing of a folder pointed by a shared link was and is possible/supported. Unfortunately, the information provided by /2/files/list_folder doesn't contain nested links info. You should process one by one all nested entries to receive the nested entries links (something relatively slow, as was mentioned). 🤷 That's it.

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

    DoControl I see Здравко offered some additional information and insight. And for reference, there isn't any news on the original request regarding /2/sharing/list_shared_links.

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!