You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Konstantinos Giotis
5 years agoExplorer | Level 3
Getting shared link for each file takes a lot of time
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.
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 GiotisExplorer | 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...
- Greg-DBDropbox Staff
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 GiotisExplorer | Level 3
Thank you very much. Works like a charm!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 6 hours ago
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 or Facebook.
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!