You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

dhoerl1's avatar
dhoerl1
New member | Level 2
5 years ago

Create an App, get a Auth Token, try to use CURL to upload file, get a 400

Obviously I'm missing something.

 

I have an account, and created an App. I also created an OAUTH Token. I then found this curl script, and want to uplaod a file:

 

curl -X POST https://content.dropboxapi.com/2/files/upload \

    --header "Authorization: Bearer <token>" \

    --header "Dropbox-API-Arg: {\"path\": \"/1.jpg\"}" \

    --header "Content-Type: application/octet-stream" \

    --data-binary @./Cushion.jpg

 

I get this return: 

Error in call to API function "files/upload": Your app is not authorized to use this endpoint.

 

So how to I get it authorized?

  • User error - hadn't hit the SUBMIT button when I set the permissions. I just didn't see it buried at the bottom of the page, in a floating panel.

  • dhoerl1's avatar
    dhoerl1
    New member | Level 2

    User error - hadn't hit the SUBMIT button when I set the permissions. I just didn't see it buried at the bottom of the page, in a floating panel.

    • Greg-DB's avatar
      Greg-DB
      Icon for Dropbox Staff rankDropbox Staff

      Thanks for following up. I'm glad to hear you already sorted this out. 

       

      For reference for anyone else who comes across this, the "Your app is not authorized to use this endpoint" error indicates that the app for the access token you're using to make the call does not have the necessary scope needed for calling that particular endpoint.

      You can find information about what scope is needed for each endpoint in the documentation. For example, for /2/files/upload, you need the 'files.content.write' scope.

      If your app doesn't already have the scope enabled, you can add it via the "Permissions" tab on the app's info page on the App Console. Then you can get a new access token with that scope added and use that new access token to make the API call.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,914 PostsLatest Activity: 4 hours ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!