Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Suporte S.
9 years agoNew member | Level 1
list_shared_links from folder
Hi.
On the API says "If a non-empty path is given, returns a list of all shared links that allow access to the given path"
I have a folder with 5 files and 3 of them has a shared link
When i ask for list_shared_links and pass the path to this folder the result is empty.
curl -X POST https://api.dropboxapi.com/2/sharing/list_shared_links \
--header 'Authorization: Bearer my-key' \
--header 'Content-Type: application/json' \
--data '{"path":"/myfolder"}'
On the API it show this example
{
"path": "/Homework/Math"
}
So it is possible, but i get this.
{
"links": [],
"has_more": false
}
When i let the data empty show all the links that i have shared, in all folders.
2 Replies
Replies have been turned off for this discussion
- Greg-DB9 years ago
Dropbox Community Moderator
That path parameter isn't a filter, exactly. Rather, the documentation also says:
"If a non-empty path is given, 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. "
That means that calling for /myfolder won't list links for /myfolder/myfile. It will only list links for anything that allows access to /myfolder itself (either links for /myfolder specifically, or for parents of /myfolder.)
If you want to get the existing links for the contents of /myfolder, you'll need to iterate through the contents and call list_shared_links for each one.
- Suporte S.9 years agoNew member | Level 1
ok, that's exactly what i ended up doing.
thanks.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!