We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.
Forum Discussion
MeloX
3 years agoExplorer | Level 3
uploadToDropbox cURL Root
Hi,
I was trying cURL, but I am pretty bad at it.
I would need your assistance.
function uploadToDropbox($path, $folder="\0", $name="") {
$url = "https://api.dropbox.com/oauth2/to...
- 3 years ago
By default, API calls operate in the "member folder" of the connected account, not the "team space". That is why you would get files uploaded to your own member folder by default. From your description, you want to upload them to the team space instead.
You can configure API calls to operate in the "team space" instead. To do so, you'll need to set the "Dropbox-Api-Path-Root" header. In the code you shared here, I see you do have the "Dropbox-Api-Path-Root" header, but you're setting a "namespace_id" of "7". The "7" is just an example from the guide/documentation. For your actual code, you will need to set your own value. Refer to the Team Files Guide and Path Root Header Modes documentation for information on how to retrieve and use the correct value for the connected account.
Greg-DB
Dropbox Staff
By default, API calls operate in the "member folder" of the connected account, not the "team space". That is why you would get files uploaded to your own member folder by default. From your description, you want to upload them to the team space instead.
You can configure API calls to operate in the "team space" instead. To do so, you'll need to set the "Dropbox-Api-Path-Root" header. In the code you shared here, I see you do have the "Dropbox-Api-Path-Root" header, but you're setting a "namespace_id" of "7". The "7" is just an example from the guide/documentation. For your actual code, you will need to set your own value. Refer to the Team Files Guide and Path Root Header Modes documentation for information on how to retrieve and use the correct value for the connected account.
MeloX
3 years agoExplorer | Level 3
Thank you so much, Greg!
I got it to work!
I appreciate your help.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 2 hours agoIf 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!