Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

pirignao's avatar
pirignao
New member | Level 2
6 years ago

Upload a file via Dropbox API and CURL

Hi everybody,

Complete newbie here, so the answer will most likely be some sort of syntax error.

For work I am running scripts on a server and I would like to get the results automatically uploaded to some dropbox folder of mine.

Here is what I am executing, based on some random googling:

curl -X POST https://content.dropboxapi.com/2/files/upload --header "Authorization: Bearer <Access Token> " --header "Dropbox-API-Arg: {\"path\": \"/try/matrices.txt\"}" --header "Content-Type: application/octet-stream" --data-binary @"matrices.txt"

where of course <Access Token> is my OAuth 2 generated access token.

Here is what I am getting:

{"error_summary": "missing_scope/", "error": {".tag": "missing_scope", "required_scope": "files.content.write"}}

What does that mean?
Thanks!

 

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    The 'missing_scope' error indicates that while the app is permitted to use that scope, the particular access token you're using to make the API call does not have that scope granted. Also, be aware that just adding a scope to your app via the App Console does not retroactively grant that scope to existing access tokens.

     

    That being the case, to make any API calls that require that scope, you'll need to get a new access token with that scope.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!