We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
Suporte S.
10 years agoNew member | Level 1
share file inside a folder by id
Hi.
I'm trying to share a file by his id.
If the file it's on the root folder, using '/create_shared_link_with_settings' i can pass only the id, and testing on the api explorer works fine.
So, i tried to do the same with a file inside a folder.
curl -X POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings \
--header 'Authorization: Bearer my-key' \
--header 'Content-Type: application/json' \
--data '{"path":"/myfolder/id:h8f3g764f73gf7fg","settings":{}}'
and this won't work.
if work on the root by logic i expected that work on any folder.
i don't want to rely on name, names can be very confusing.
It is a bug or a limitation?
2 Replies
Replies have been turned off for this discussion
- Greg-DB10 years ago
Dropbox Community Moderator
If you want to create a shared link for a file and you know the id for the file, you can just use that, as opposed to trying to combine path and id. That is, if "id:h8f3g764f73gf7fg" is the id for a file at /myfolder/myfile that you want a shared link for, you can just use the id only:
curl -X POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings \ --header 'Authorization: Bearer my-key' \ --header 'Content-Type: application/json' \ --data '{"path":"id:h8f3g764f73gf7fg","settings":{}}'
- Suporte S.10 years agoNew member | Level 1
thanks.
it worked.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,037 PostsLatest Activity: 4 hours ago
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 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!