0

the following code should work, shouldn't it?

import requests
import json

url = "https://api.dropboxapi.com/2/files/delete_v2"

headers = {
    "Authorization": "Bearer <access-token>",
    "Content-Type": "application/json",
    "Dropbox-Api-Select-Admin": 
    "dbmid:AADnRVGZHenLtFbLVdHDkqEJg3Dou4hWF4g"
}

data = {"path": "id:Kd_cXYig9pAAAAAAAAAARQ"}

print(requests.post(url, headers=headers, data=json.dumps(data)).content)

returns:

{"error_summary": "path_lookup/not_found/", "error": {".tag": "path_lookup", "path_lookup": {".tag": "not_found"}}}

Tried using Dropbox-Api-Select-User, and delete(v1) and permanently_delete and all failed with the same error.

FYI download worked. (only with Select-Admin, but worked).

1

1 Answer 1

0

Thanks Greg. Added "Dropbox-Api-Path-Root" header with the parent_shared_folder_id and the api call worked!

headers = {
"Authorization": "Bearer f7I8uYSFpxAAAAAAAAAFSs-VIz17DnoqmEYXp0MeitxIzXBCYCT4v0Bb4N4_cbxK",
"Content-Type": "application/json",
"Dropbox-Api-Path-Root": "{\".tag\": \"namespace_id\", \"namespace_id\": \"2857852064\"}",
"Dropbox-Api-Select-Admin": "dbmid:AADnRVGZHenLtFbLVdHDkqEJg3Dou4hWF4g"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.