cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Whether you are transferring a single drive, a team or an entire organization, Movebot's cloud migration tool has been built to make your Dropbox migration simple - learn all about it here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting shared link for each file takes a lot of time

Getting shared link for each file takes a lot of time

Konstantinos Giotis
Explorer | Level 3

Hello everyone!

Im building something associated with dropbox for my thesis. As I am fetching the files with the 'files/list_folder' endpoint, I wanted for each file, to check if it has a "shared link" . For example, in my drive I have 42 files in root folder. Fetching all those files plus for each file fetching if it has a shared link using the 'sharing/list_shared_links' , takes a huge amount of time. It takes ~0.6 seconds for each request so for 42 files that is ~25 seconds! Thats kinda slow but I can recognise that its usual since i make multiple requests.

 

So my question is, if there is something "fancier" and more time consuming that I can do since thats a big problem for me currently.

Thank you.

1 Accepted Solution

Accepted Solutions

Re: Getting shared link for each file takes a lot of time

Greg-DB
Dropboxer

If you call /2/sharing/list_shared_links without specifying the "path" parameter, it should return a list of all of the shared links for the connected account. You could then check the list of files against that entire list of shared links. That would likely be faster than calling /2/sharing/list_shared_links for each one. (Note that the /2/sharing/list_shared_links interface is paginated though, so be sure to check the returned 'has_more' value and call back again if needed. Check out the 'has_more' field documentation for more information.)

View solution in original post

3 Replies 3

Re: Getting shared link for each file takes a lot of time

Konstantinos Giotis
Explorer | Level 3

I forgot to mention, that I don't mind if I dont get the shared link. I just want to check if the file is "shared" in the first place. But in the files metadata this info doesn't exist from what I found...

Re: Getting shared link for each file takes a lot of time

Greg-DB
Dropboxer

If you call /2/sharing/list_shared_links without specifying the "path" parameter, it should return a list of all of the shared links for the connected account. You could then check the list of files against that entire list of shared links. That would likely be faster than calling /2/sharing/list_shared_links for each one. (Note that the /2/sharing/list_shared_links interface is paginated though, so be sure to check the returned 'has_more' value and call back again if needed. Check out the 'has_more' field documentation for more information.)

Re: Getting shared link for each file takes a lot of time

Konstantinos Giotis
Explorer | Level 3

Thank you very much. Works like a charm!

Who's talking

Top contributors to this post

  • User avatar
    Konstantinos Giotis Explorer | Level 3
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?