cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Delete does not work on files

Delete does not work on files

Amiram
New member | Level 2

hey guys i'm trying to delete a file and always get `path_lookup/not_found/..`

the code is:

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

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

further more https://dropbox.github.io/dropbox-api-v2-explorer/#files_delete
only lets you try the deprecated api call. trying on stackoverflow as well: https://stackoverflow.com/questions/52368896/cant-delete-files-using-a-dropbox-business-team-token
Screen Shot 2018-09-17 at 15.59.48.png

1 Accepted Solution

Accepted Solutions

Re: Delete does not work on files

Greg-DB
Dropboxer

Does that file exist in the "team space"? By default, API calls will only look in "member folders", so this code won't work if the file is in the team space. To operate in the team space, you need to set the 'Dropbox-API-Path-Root' header. You can find information on how to do this in the Namespace Guide:

https://www.dropbox.com/developers/reference/namespace-guide

(And thanks for the note on the API Explorer being outdated! I'll ask the team to update it.)

View solution in original post

2 Replies 2

Re: Delete does not work on files

Amiram
New member | Level 2

edited the main comment

Re: Delete does not work on files

Greg-DB
Dropboxer

Does that file exist in the "team space"? By default, API calls will only look in "member folders", so this code won't work if the file is in the team space. To operate in the team space, you need to set the 'Dropbox-API-Path-Root' header. You can find information on how to do this in the Namespace Guide:

https://www.dropbox.com/developers/reference/namespace-guide

(And thanks for the note on the API Explorer being outdated! I'll ask the team to update it.)

View solution in original post

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Amiram New member | Level 2
What do Dropbox user levels mean?
Need more support?