cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right 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: 

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
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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.

abhikarn
Explorer | Level 3
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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.

abhikarn
Explorer | Level 3
Go to solution

Hi Greg, Thanks a lot. It worked. :slightly_smiling_face:

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    abhikarn Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?