Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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.
Previously by using v1 it was like:
var accessToken = new OAuthProtocol.OAuthToken(auth_Token, auth_Token_Secret); var api = new DropboxApi(dropbox_appkey, dropbox_appsecret, accessToken); var accountInfo = api.GetAccountInfo();
Thank you.
Using 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_GetCurr...
https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Users_Routes_UsersUserRoutes_GetSpac...
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.
The Dropbox API v2 .NET SDK officially supports .NET Framework 4+, so you shouldn't need to upgrade to 4.5.
How exactly did you install it? Also, can you confirm that you installed the latest version (currently v4.3.1)?
Hi Greg,
I have one of my winform project (framework 4.0) then added one more project name "dropboxV2" (framework 4.0) to the same solution and set this project output type as "Class Library". I went to package manager console then run "Install-Package Dropbox.Api", after completion i got "Successfully installed 'Dropbox.Api 4.3.1' to dropboxV2".
I have a class like in newly added project:
public async void GetCurrentAccount(string accessToken) { using (var client = new DropboxClient(accessToken)) { var fullAccount = await client . Users.GetCurrentAccountAsync(); } }
Now i'm accessing above method from my main project as:
dropboxV2.DropboxHelper helper = new dropboxV2.DropboxHelper(); helper.GetCurrentAccount(access_token); // here i'm getting exception
What i'm doing wrong here? Please help.
Thank you.
Hi there!
If you need more help you can view your support options (expected response time for a 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!