Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
luiseliberal
8 years agoNew member | Level 2
Authentication with new api v2, generated token, aways return users null to me
Dear dropbox comunity,
I cannot complete a full authentication within my dropbox account and my android application. The app is in development status, with generated token by console, and the users object is always null after connection....
mDboxClientV2.users().getCurrentAccount()
I have to ask you, why i'm always getting a half authentication with this v2 method, how to get the current account?
public static DbxClientV2 init(String accessToken) {
if (sDbxClient == null) {
DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder("fotosinspecc")
.withHttpRequestor(new OkHttp3Requestor(OkHttp3Requestor.defaultOkHttpClient()))
.build();
sDbxClient = new DbxClientV2(requestConfig, accessToken);
//Constants.setClient(sDbxClient);
}
return sDbxClient;
}
Thanks in advance for youe com=ments, regards
1 Reply
- Greg-DB8 years ago
Dropbox Community Moderator
What you have seems correct. There are a few examples here:
https://github.com/dropbox/dropbox-sdk-java/blob/1b6cde9b789f5eb089cde4bbe588da2cea85b597/ReadMe.md#link-an-account
https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/account-info/src/main/java/com/dropbox/core/examples/account_info/Main.java#L58
https://github.com/dropbox/dropbox-sdk-java/blob/c6aeb4bf3011e6b803eaa325ea20a52f8412ee0f/examples/tutorial/src/main/java/com/dropbox/core/examples/tutorial/Main.java#L29
A few things to help track this down:
- How are you setting mDboxClientV2? (Presumably you're calling that init method?)
- What version number of the SDK do you have installed?
- What error exactly are you getting?
About 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!