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/"
}