cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Android InvalidAccessTokenException at attempt to load file after auth.

Android InvalidAccessTokenException at attempt to load file after auth.

Taras L.
New member | Level 2

I've got InvalidAccessTokenException at any attempt to upload file to Dropbox.

For authorization I use next algorithm:

Auth.startOAuth2Authentication(context, APP_KEY);

//granting access
//previous activity is reopened

String accessToken = Auth.getOAuth2Token();
DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder(CLIENT_ID)
                    .withHttpRequestor(OkHttp3Requestor.INSTANCE)
                    .build();
DbxClientV2 client = new DbxClientV2(requestConfig, accessToken);
DropboxClientFactory.getClient().files().uploadBuilder(ADDRESS_IN_DROPBOX)
                            .uploadAndFinish(inputStream);

 

which returns InvalidAccessTokenException.

Maybe I/m doing something wrong.

PS I used Android project as example - https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android 

2 Replies 2

Taras L.
New member | Level 2

DropboxClientFactory.getClient() = client in previous post.

 

And problem appears only after revoking access from account settings at Dropbox webpage.

Greg-DB
Dropbox Staff
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Taras L. New member | Level 2
What do Dropbox user levels mean?