We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
DavidPaynter
8 years agoExplorer | Level 3
Convert V1 User to V2 User With V2 BasicAccount Details
We have a set of applications that have been using the Dropbox V1 API and the users' Display Name, Token Value and Secret Value have been stored in the DB. We are now wanting to seamless convert the users' accounts across to the V2 API, without the users having to reauthenticate their accounts via the Dropbox website.
We have achieved converting the V1 Token and Secret to a V2 Token using the Api.Auth.TokenFromOauth1Async method. So we now have the V2 Token value only returned by this method.
How do we retrieve all the users' other details (BasicAccount) from just having the V2 Token?
It would appear that the GetAccountAsync method would return the desired user data, such as: Uid, Display Name, etc. However, the input parameter for this call is the Uid, but we only have the V2 AccessToken available.
FullAccount is a subclass of Account, which does include Email and Name.
var account = await this.client.Users.GetCurrentAccountAsync(); Console.WriteLine(account.Name.DisplayName); Console.WriteLine(account.Email);
- Greg-DBDropbox StaffYou can instead use GetCurrentAccountAsync to get the linked user's account information (i.e., for the user identified by the access token you use for the call), without specifying a user ID:
https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Users_Routes_UsersUserRoutes_GetCurrentAccountAsync.htm
So, call that with each access token you need to associate with user information.- DavidPaynterExplorer | Level 3
The GetCurrentAccountAsync method returns FullAccount class - which does not include the User's personal information such as Name and Email, so that method doesn't work.
What method do I call to return the Account Class and/or the Name Class?
- Greg-DBDropbox Staff
FullAccount is a subclass of Account, which does include Email and Name.
var account = await this.client.Users.GetCurrentAccountAsync(); Console.WriteLine(account.Name.DisplayName); Console.WriteLine(account.Email);
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 4 hours 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!