cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Great and all as it is to hear how we use Dropbox, we want to know how you use it! Day to day, big projects, sharing files with friends and family - we want to know about it.

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: 

Authentication for File getContent - https://content.dropboxapi.com/2/cloud_docs/get_content

Authentication for File getContent - https://content.dropboxapi.com/2/cloud_docs/get_content

abhikarn
Explorer | Level 3

Hi,

While cosumning the api to get the file content ( https://content.dropboxapi.com/2/cloud_docs/get_content).

I am facing an error mentioned below:

 

Error in call to API function "cloud_docs/get_content": Invalid authorization value in HTTP header "Authorization": "Bearer <myApp access token>". Expecting "Bearer cd.<auth_token>". '// Here in myApp access token I have provide the app access token.

 

Am I passing the correct token?, as in the description of this service I saw one information "Please make a request to cloud_docs/authorize and supply that token in the Authorization header". But I did not find any information on that.

 

Please help in this regard.

 

 

1 Accepted Solution

Accepted Solutions

Re: Authentication for File getContent - https://content.dropboxapi.com/2/cloud_docs/get_content

Greg-DB
Dropboxer

The /2/files/download endpoint is a "content-download" style endpoint, meaning it expects the parameters in the 'Dropbox-API-Arg' request header, not the request body. 

 

You're sending your parameters in the request body, so it's returning that error. Move your parameter JSON to the 'Dropbox-API-Arg' request header instead.

View solution in original post

4 Replies 4

Re: Authentication for File getContent - https://content.dropboxapi.com/2/cloud_docs/get_content

Greg-DB
Dropboxer

If you're trying to download file content, you should instead use /2/files/download, for normal files, or /2/files/export, for things that can't be downloaded normally. 

 

Please refer to the documentation linked above for more information and examples.

Re: Authentication for File getContent - https://content.dropboxapi.com/2/cloud_docs/get_content

abhikarn
Explorer | Level 3

Hi Greg,

 

I tried the api https://content.dropboxapi.com/2/files/download, but seeing an unsual error.

Error in call to API function "files/download": The request body is supposed to be empty, but it isn't; got "{\x0D\x0A \"path\": \"/IssueTrackerV4.xlsx\"\x0D\x0A}".

 

Not sure what is the issue. My request bod has below content:

{
    "path""/IssueTrackerV4.xlsx"
}

Re: Authentication for File getContent - https://content.dropboxapi.com/2/cloud_docs/get_content

Greg-DB
Dropboxer

The /2/files/download endpoint is a "content-download" style endpoint, meaning it expects the parameters in the 'Dropbox-API-Arg' request header, not the request body. 

 

You're sending your parameters in the request body, so it's returning that error. Move your parameter JSON to the 'Dropbox-API-Arg' request header instead.

Re: Authentication for File getContent - https://content.dropboxapi.com/2/cloud_docs/get_content

abhikarn
Explorer | Level 3

Hi Greg, Thanks a lot. It worked. 🙂

Who's talking

Top contributors to this post

  • User avatar
    abhikarn Explorer | Level 3
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?