We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
suihakei
6 years agoExplorer | Level 3
I want to upload files to Dropbox Business using the Dropbox API
# Summary
I used the "/2/files/upload" endpoint of the Dropbox API.
However, the file is uploaded to your personal folder.
I want to upload files to the team folder using the API.
# T...
Greg-DB
Dropbox Community Moderator
6 years agoThe 'Dropbox-API-Path-Root' header does not support a 'shared_folder' option. Please refer to the Namespace Guide for information and examples on how to use the header, such as what options it supports:
https://www.dropbox.com/developers/reference/namespace-guide
For example, it sounds like you probably want to use the 'namespace_id' option.
suihakei
6 years agoExplorer | Level 3
Thank you for your reply.
As you explained, I set it as follows.
'Dropbox-API-Path-Root' => json_encode([
'.tag' => 'namespace_id',
'namespace_id' => 'xxxxxxxxxxxxx',
]),However, I get the following error:
`POST https://content.dropboxapi.com/2/files/upload` resulted in a `400 Bad Request` response: Error in call to API function "files/upload": This API function operates on a single Dropbox account, but the OAuth 2 ac (truncated...)
Why is this?
I would appreciate it if you could advise me.
Thank you.
- Greg-DB6 years ago
Dropbox Community Moderator
It looks like you or your HTTPS client truncated the error message. Please print out the full error message information, as it will contain more information about the specific error scenario.
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!