One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
rnj1776
6 years agoExplorer | Level 3
list_shared_links says I have no shared links...but I do have them..,
So...I made a call to `list_shared_links` precisely because a call to create a shared link said the link already existed...I didn't cache some of them originally...so I was writing code to detect this error and list shared links so it could cache them...but it's saying I have no files in a folder I know that I do....
curl -X POST https://api.dropboxapi.com/2/sharing/list_shared_links \ --header 'Authorization: Bearer <token here>' \ --header 'Content-Type: application/json' \ --data '{"path":"/_Johnson'\''s Heavy Salvage/salvage folders/67918 - 2012 Kenworth T660 - CJ/Original"}'
I had my token in the curl command above and got:
{"links": [], "has_more": false}
But when I had it list all shared links without a path...it showed other folders...I copied the path line from the results and used it in a curl call...and it showed no shared links either...despite the fact it did in the API Explorer...but only if you put no path in...
Any help with this would be appreciated. I can't create new shared links to the files I'm calling for because it says they already exist...so my hands are tied.
Actually I do have one more question...
=====CreateSharedLink.ERROR: 'shared_link_already_exists/metadata/..'
The previous is one of my debug lines...the error returned has metadata/.., but sometimes it's ..., or ., sometimes no dots...I'm not sure if this is a Dropbox thing...or some byproduct of the Go library I'm using to access the Dropbox API.
Thanks, Steve
- Greg-DB
Dropbox Staff
To clarify, were you calling /2/sharing/create_shared_link_with_settings with the "path" for that "Original" folder itself, or with a path for a file inside that folder?
Note that the /2/sharing/list_shared_links works in the two different following ways:
- "If no path is given, returns a list of all shared links for the current user."
- "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."
So, supplying as path to a folder will not make it list the shared links for files inside that folder. If you want the shared links for a file, you need to specify the full path for the file.
Also, the variable anount of trailing periods are intentionally added by Dropbox, to discourage clients from doing exact string matching on these error string, in favor of prefix matching. This way, we can add nested errors without breaking clients.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 2 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!