Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
I can't seem to be able to use the Business API in its V2 incarnation.
First of all, what is the correct header to send?
Here it's Dropbox-API-Select-Team-Member and here it's X-Dropbox-Perform-As-Team-Member.
This works in v1:
url = 'https://content.dropboxapi.com/1/files_put/auto'
headers = {
'Authorization': 'Bearer ' + access_token,
'Content-Type': 'application/json',
'X-Dropbox-Perform-As-Team-Member': member_id
}
with open(local_filename, 'rb') as f:
r = requests.put(url + remote_path, headers=headers, data=f)
But this does not work in v2:
url = 'https://content.dropboxapi.com/2/files/upload'
headers = {
'Authorization': 'Bearer ' + access_token,
'Content-Type': 'application/octet-stream',
"Dropbox-API-Arg": "{\"path\":\"" + remote_path + "\"}",
'Dropbox-API-Select-Team-Member': member_id
}
with open(local_filename, 'rb') as f:
r = requests.post(url + headers=headers, data=f)
It fails with:
{
"error": {
".tag": "invalid_access_token"
},
"error_summary": "invalid_access_token/"
}
Sorry, the second link is to the old v1 documentation. We're going to clean that up to redirect to the right place.
So the first header (`Dropbox-API-Select-Team-Member`) should be right.
This line looks fairly wrong. Is that just a typo when you copied it here?
requests.post(url + headers=headers, data=f)
Sorry, yes it is a typo, it should be:
r = requests.post(url, headers=headers, data=f)
I still get the error. Also with any API call on v2. Any idea of what I should change?
Thanks for your help!
It looks like this is a bug on our side. We're looking into it.
Apologies, the documentation is wrong. We'll get that fixed up. The header should be "Dropbox-API-Select-User". Please try that and let us know if you still see any issues.
It seems to work fine now 🙂
Thanks a lot!
Hi there!
If you need more help you can view your support options (expected response time for a 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!