cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

OAuth get file request fails with file not found

New member | Level 1
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
Highlighted

Re: OAuth get file request fails with file not found

Dropboxer
Dropboxer

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.

Highlighted

Re: OAuth get file request fails with file not found

New member | Level 1
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!

Highlighted

Re: OAuth get file request fails with file not found

New member | Level 1
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

Highlighted

Re: OAuth get file request fails with file not found

Dropboxer
Dropboxer

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")?

Highlighted

Re: OAuth get file request fails with file not found

New member | Level 1
New member | Level 1

Steve, without "/dropbox" I get 

{"error": "Unauthorized"}
Highlighted

Re: OAuth get file request fails with file not found

Dropboxer
Dropboxer

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).

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?