cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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

Konstantinos Giotis
Explorer | Level 3
Go to solution

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...

Greg-DB
Dropbox Staff
Go to solution

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.)

Konstantinos Giotis
Explorer | Level 3
Go to solution

Thank you very much. Works like a charm!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Konstantinos Giotis Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?