We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

novotny's avatar
novotny
Explorer | Level 4
3 years ago

missing scope files.metadata.read

Hi,

 

I'm using the Java SDK and I have enabled files.metadata.read in my oermissions, see screenshot. However in my Java code I see:

 

com.dropbox.core.InvalidAccessTokenException: {"error_summary": "missing_scope/.", "error": {".tag": "missing_scope", "required_scope": "files.metadata.read"}}

 

What am I missing?

 

In addition I just copied from the java tutorial this line:

DbxRequestConfig config = DbxRequestConfig.newBuilder("dropbox/java-tutorial").build();

Which seems ok, what is the purpose of string "dropbox/java-tutorial" and I assume it can be any string?

 

Thanks, Jason

  • A '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.

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

     

    The string you pass to DbxRequestConfig.newBuilder should be a name identifying your app. That doesn't control the scopes.

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

    A '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.

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

     

    The string you pass to DbxRequestConfig.newBuilder should be a name identifying your app. That doesn't control the scopes.

    • timrobinson33's avatar
      timrobinson33
      Helpful | Level 5

      Thanks - this is what I had missed first time:

       


      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.

      for any other newbies getting confused by this, after adding permissions in the permissions tab, you need to go back to the settings tab and generate another access token

       

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 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!