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
PPT320
4 years agoNew member | Level 2
Missing scope from request
Hi, I'm looking for some help setting up an Android app with the api. I am looking to list all files in a dropbox folder, select one to download and then read it into my app to process the data....
- 4 years ago
You can actually do either.
If you want it to default to whatever is set for the app on the App Console at that point in time, you should pass in null.
If you want to be specifically defined by the code, even if additional scopes are added to the App Console, you should pass the specific desired scope list. (Note that you can't request scopes that aren't enabled for the app though.)
Greg-DB
Dropbox Staff
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. It sounds like you've already done so though, so I also recommend checking the code you're running to process the authorization flow itself. While the scopes you enable on the App Console are used as the default scopes for the app, the app can also optionally specify a smaller set of scopes at authorization time. For example in this line of code in the sample app, it only requests "account_info.read" and "files.content.write". You would need to modify that if you want to request "files.content.read" as well.
PPT320
4 years agoNew member | Level 2
Thanks for your reply Greg,
So do you mean remove the arrays completely to force use of defaults, like
DropboxActivity.startOAuth2Authentication(UserActivity.this, getString(R.string.app_key), null);
or actually add the files.content.read like
DropboxActivity.startOAuth2Authentication(UserActivity.this, getString(R.string.app_key), Arrays.asList("account_info.read", "files.content.read", "files.content.write"));
I would prefer if it called all be controlled from the app on dropbox/developer
- Greg-DB4 years agoDropbox Staff
You can actually do either.
If you want it to default to whatever is set for the app on the App Console at that point in time, you should pass in null.
If you want to be specifically defined by the code, even if additional scopes are added to the App Console, you should pass the specific desired scope list. (Note that you can't request scopes that aren't enabled for the app though.)
- PPT3204 years agoNew member | Level 2
Thanks Greg,
I changed it to null and after initially failing because the example app then tried to open the file but its format won't allow it. I commented out the link to view the file and its now appears to be working. Thanks for your help.
new DownloadFileTask(FilesActivity.this, DropboxClientFactory.getClient(), new DownloadFileTask.Callback() {
@Override
public void onDownloadComplete(File result) {
dialog.dismiss();
//if (result != null) {
// viewFileInExternalApp(result);
//}
}
About Discuss Dropbox Developer & API
Make connections with other developers
795 PostsLatest Activity: 6 days agoIf 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!