Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

LOWRY G.'s avatar
LOWRY G.
New member | Level 1
9 years ago

.NET SDK System.AggregateException OAuth 2 access token is malformed ?

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

2 Replies

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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!