Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Message=Error in call to API function "users/get_current_account":
The given OAuth 2 access token is malformed.
https://www.dropbox.com/developers/documentation/dotnet#tutorial
(a) installed Dropbox .NET SDK via NuGet
(b) registered Dropbox API app using the "App Console"
(c) copied this text from the .NET tutorial page mention above.
(d) replaced "YOUR ACCESS TOKEN" in the line below with the App key from step (b) above:
using (var dbx = new DropboxClient("YOUR ACCESS TOKEN"))
(e) the code compiles BUT crashes on the line after the using:
var full = await dbx.Users.GetCurrentAccountAsync();
The ERROR is:
Message=Error in call to API function
"users/get_current_account":
The given OAuth 2 access token is malformed."
The app key provided by the Dropbox App Console
is 15 alphanumeric characters with this form:
aannnaaaaaaaana
How can it be malformed when it was copied and pasted
from the middle of a page with an URL that even contained
the App key as part of the URL:
https://www.dropbox.com/developers/apps/info/aannnaaaaaaaana
The outer exception is:
System.AggregateException was unhandled
HResult=-2146233088
[Cross-linking for reference: https://stackoverflow.com/questions/38462091/net-sdk-system-aggregateexception-oauth-2-access-token-... ]
It looks like you're using your app's "app key", instead of an "access token". These are different from each other. The app key identifies your app, whereas an access token identifies an app-user pair, and allows access to that user's account.
You can generate an access token for your app on your account on the app's page on the App Console, using the "Generate" button.
Gregory, thank you. much appreciated. issue is resolved.
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!