Forum Discussion

cris3c's avatar
cris3c
Explorer | Level 4
6 years ago

Reading content from a file and show it WITHOUT downloading

hi all,

 

Currently I am developing an Android App with Android Studio and I got Dropbox API to get information from Dropbox. I am blocked with a method to get information from Dopbox account (.txt, .html, .jpg whatever file is displayed there) and display it on the screen of the simulator without download that file in any folder (reading directly from Dropbox). I am new with the API, could anyone share with me an example code to archieve it? or send me any information about that.

 

Thank you.

13 Replies

Replies have been turned off for this discussion
  • 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. 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.

  • cris3c's avatar
    cris3c
    Explorer | Level 4
    6 years ago

    Hi Greg,

     

    Once I have checked all the scopes I need, everything I have to do is GENERATE an access token as you see in the image:

    After that, have I to write that access token in any site of the android example code? If I have to, where? When it is generated, will everything be there or do I have to do something to write it somewhere in the code?

     

    Thanks!

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

    Normally, you should implement the OAuth app authorization flow in your app, as shown in this example, in order to allow the end-user to connect their own Dropbox account so the app can receive the access token for that user's account programmatically once they approve it.

     

    If you are only connecting your own account in particular though, you technically don't need to implement the app authorization flow. You can just hard-code your own access token like in this example. (Though, if you're using short-lived access tokens and refresh tokens for offline/background access, you'd want to use this constructor instead.) Note that access tokens allow access to your account though, so you shouldn't distribute them to other people.

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!