We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
gilbertwulff
9 years agoExplorer | Level 3
Uploading to a shared folder through api
I'm working on integrating dropbox to my company's website and we want to add a feature in to allow the users to share their shared folders to us and using the dropbox api, we upload files to the sha...
Greg-DB
Dropbox Community Moderator
9 years agoYes, the Dropbox API does offer the ability to both share folders and upload into shared folders.
To share a folder with another account, you can use /2/sharing/share_folder to share the folder, and /2/sharing/add_folder_member to invite another account.
On the recipient account, you can list folders that you can add to the account using /2/sharing/list_mountable_folders[/continue] and then add them to your account using /2/sharing/mount_folder.
You can then upload to the folder using /2/files/upload.
We recommend using an official SDK, if one is available for your platform. They will have corresponding methods for the above endpoints.
Note that when you register the API app for this, you'll need to use the "full Dropbox" permission, not "app folder". Apps with the app folder permission can't access shared folders.
- gilbertwulff9 years agoExplorer | Level 3
Thanks for your reply!
I saw that API endpoint too, now that confirms that i was looking at the right thing.
Next question is, how exactly would i put the path in. The path being the recipient's shared folder link.
"path": "/Homework/math/Matrices.txt",
It worked when i was saving to my account's folder path but i tried putting in the recipient's shared folder link but it didnt work.
How exactly should the format be.
- Greg-DB9 years ago
Dropbox Community Moderator
A shared folder can different paths in different accounts (since users can move shared folders, etc.) That being the case, when operating on a shared folder via path, make sure you're using the path from the account you're operating on. The SharedFolderMetadata, e.g., returned by /2/sharing/list_folders[/continue] returns the path for the linked account, so make sure you're calling on the right account.
Anyway, I mentioned several endpoints, so I'm not sure exactly what step you're getting stuck on. If you're running in to an issue, please share the code and output showing it.- gilbertwulff9 years agoExplorer | Level 3
Yeap that was one of the way that i tested and it worked. But i'm talking bout when a user just gives us a shared link to their folder instead of adding us to the shared user's list on the folder
Is there a way to upload to that folder with just the shared folder link that they gave us? or do we have to be given access to the folder and then we will have to use the path that we get from /2/sharing/list_folders[/continue] on our own account and then upload to that path.
Can we directly upload to the folder link that the recipient on another account gives us (image attached is the way they get the folder link)
- Wuyi8 years agoNew member | Level 2
In a request to make folder shareable, i got
REQUEST
curl -X POST https://api.dropboxapi.com/2/sharing/share_folder \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{"path":"/pictures/hello","link_settings":{}}'
RESPONSE
{ "error_summary": "no_permission/", "error": { ".tag": "no_permission" }, "user_message": { "locale": "en", "text": "You don’t have permission to perform this action." } }
What exactly am doing wrong?
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!