We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
victorTm90
3 years agoExplorer | Level 3
Getting shared Link: Problem with permissions.
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
Replies have been turned off for this discussion
- Greg-DB3 years ago
Dropbox Community Moderator
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'.
- victorTm903 years agoExplorer | 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-DB3 years ago
Dropbox Community Moderator
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).
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 3 hours ago
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 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!