cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
If you’ve changed your email address, now's the perfect time to update it on your Dropbox account and we’re here to help! Learn more 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: 

Re: OAuth get file request fails with file not found

OAuth get file request fails with file not found

Amit1
New member | Level 1

I have been trying the OAuth api and wasn't able to get a file using the files get api as detailed here - https://www.dropbox.com/developers/core/docs#files-GET

My request looks as below
https://api-content.dropbox.com/1/files/auto/Images/thankyou.jpg
with the header - Authorization=Bearer <access-token>

I get a 404 error with the body as

{
    "error": "File not found"
}

Note that the account info api call succeeds. The files api call fails.
I have tried multiple forms of the get request but all of them give the same error
https://api-content.dropbox.com/1/files/auto/APIsForDummies.pdf
and https://api-content.dropbox.com/1/files/auto/Getting Started.pdf

How should the file path be given to make the api call succeed?

Thanks

6 Replies 6

Steve M.
Dropbox Staff

Does your app have "Full Dropbox" or "App folder" permission?

In the app folder case, the root of your paths refers to the app folder, so /files/auto/Images/thankyou.jpg will look for a file in /Dropbox/Apps/<your app name>/Images/thankyou.jpg.

It might help if you make a metadata call so you can see what's actually in Dropbox first: https://api.dropbox.com/1/metadata/auto (with the Authorization header). The paths you see there should work when you call /files.

Amit1
New member | Level 1

Great. You were spot on. I had placed the files under the root folder and not inside the app folder. It worked after I place my files under the App folder and try making the /files api call.

I had initially tried the metadata api call but it seems that the documentation (https://www.dropbox.com/developers/core/docs#metadata) mentions that the api calls requires the path and I misinterpreted it. Not passing the path works is what didn't click me earlier.

Thanks a ton!

InF B.
New member | Level 1

Have the same issue. I have "Full Dropbox" permission

{"error": "File not found"}


Under root I have "folder" folder and inside it left.png 

Path is retrieved by metadata


https://api-content.dropbox.com/1/files/auto/dropbox/folder/left.jpg?oauth_consumer_key=23ji9ydhhprk...

With App folder all works. But I need "Full Dropbox" permission

Steve M.
Dropbox Staff

InF B, /1/files/auto/dropbox/folder/left.jpg looks wrong. Based on your description of the location of the file, shouldn't that be /1/files/auto/folder/left.jpg (no "/dropbox")?

InF B.
New member | Level 1

Steve, without "/dropbox" I get 

{"error": "Unauthorized"}

Steve M.
Dropbox Staff

Did you construct the right OAuth signature after changing the URL? (This error sounds like a bad OAuth signature.)

Also, is there a reason you're using OAuth 1 and HMAC signatures? OAuth 1 with PLAINTEXT signatures is easier to work with, and OAuth 2 is even easier.

Also, API v1 has been deprecated, so you may just want to move to API v2 now (which only supports OAuth 2).

Need more support?