cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Getting shared Link: Problem with permissions.

Getting shared Link: Problem with permissions.

victorTm90
Explorer | Level 3

Hello everyone!

I have developed an API for uploading files and generating links for downloading them. However, I am encountering an issue when trying to obtain a shared link.

The problem is that when I send a request to the '/get_shared_link_file' endpoint, I receive the following error:

Error: ".tag": "missing_scope", "required_scope": "share.write".

Even though I have the 'sharing.write' option selected in the App Console. I am using the kunalvarma05/dropbox-php-sdk and the 'postToAPI()' method to make the request in PHP.

If anyone could assist me with this issue, I would greatly appreciate it.

Thank you,
Víctor

3 Replies 3

Greg-DB
Dropbox Staff

A 'missing_scope' error indicates that while the app may have that scope enabled, 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.

Refer to the OAuth Guide and authorization documentation for more information.

 

By the way, it looks like you may be looking at the error for a different endpoint, or misread the error, because /2/sharing/get_shared_link_file requires 'sharing.read', not 'sharing.write'.

victorTm90
Explorer | Level 3

Hi Greg,


You were right, I hadn’t restarted the access token after changing the scope. Like you said, the required scope was ‘sharing.read’. However, the error persists, and I don’t know how to proceed in order to solve it. Do you have any idea what I can do? Thank you, and sorry about the late reply.

 

Best,
Víctor



Greg-DB
Dropbox Staff

If you're still getting a 'missing_scope' error, that means that the particular access token you're using to call that endpoint is not authorized with the scope needed for that particular endpoint.

 

Note that enabling the scope on the app itself does not grant that scope to preexisting access tokens (or refresh tokens). Likewise, if you have a preexisting refresh token, using that to get another access token will still not produce an access token with that additional scope granted; it can only produce access tokens with scopes originally granted to that refresh token.

 

To get an access token with that scope, you'll need to authorize the app again, with that scope enabled. That is, you'll need to process the OAuth app authorization flow again (or use the "Generate" button again if you just need a short-lived access token for your own account).

Need more support?
Who's talking

Top contributors to this post

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