We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Tribecube T.
11 years agoNew member | Level 1
How to get the file path from a preview link?
How can I get the proper Dropbox file path from a preview link obtained from the Dropbox Chooser? It is obviously unreliable to search for any file that matches the file name...
Greg-DB
Dropbox Community Moderator
10 years agoBy "correct user's auth", I meant that in order to get the extra information such as "path", you need to make that API call using an access token for the user account that owns the link.
E.g., see the /metadata/link documentation for in_dropbox and path:
"in_dropbox: Returns true if the file or folder is in the authenticated user's Dropbox. If no access token is passed, then this will always return false.
path: Returns the path to the file or folder relative to the shared link's root. If the in_dropbox value is true and the shared link points to a file or folder within the authenticated user's Dropbox, it returns the same path that would be returned by the /metadata endpoint. If the request is made without an authenticated user or the shared link is not in the authenticated user's Dropbox, this will always return null."
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!