We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
SauravAnand01
9 years agoExplorer | Level 3
Dropbox API V2 GetAccountInfo() - C#
I'm migrating from Dropbox v1 to v2, how can i proceed with GetAccountInfo() to get details such as: UserName, UserId, QuotaUsed, QuotaAvailable, SharedUse. How do i get this with v2. Previous...
Greg-DB
Dropbox Community Moderator
9 years agoUsing the Dropbox API v2 .NET SDK, you can get the account information like this using GetCurrentAccountAsync and GetSpaceUsageAsync:
https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Users_Routes_UsersUserRoutes_GetCurrentAccountAsync.htm
https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Users_Routes_UsersUserRoutes_GetSpaceUsageAsync.htm
- SauravAnand019 years agoExplorer | Level 3Hi Greg,
Thanks for your prompt response. Can you please provide a code block/example of any of the above method call so that i can proceed with my other various API calls and complete my migration from v1 to v2.
Only one code block or example will be really helpful.
Thank you.- Greg-DB9 years ago
Dropbox Community Moderator
There's an example of using GetCurrentAccountAsync here:
https://github.com/dropbox/dropbox-sdk-dotnet/blob/9803a40b3169acf66a2d14e29af8750ebe6e3e17/dropbox-sdk-dotnet/Examples/SimpleTest/Program.cs#L213
Calling GetSpaceUsageAsync works similarly, but with a different return type that contains the space information instead.- SauravAnand019 years agoExplorer | Level 3
Thank you for the example.
I have installed Dropbox API v2 library in a project which target framework is 4.0 and calling GetCurrentAccountAsync() as you have suggested then i'm getting exception like "Could not load file or assembly 'Dropbox.Api, Version=4.0.0.0, Culture=neutral, PublicKeyToken=310f0e82fbb45d01' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
Do i need to change target framework to 4.5 or is there any way to fix this exception. If i will have to change framework then it will be major change for my project.
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!