You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Garnik G.'s avatar
Garnik G.
Explorer | Level 4
10 years ago

How to get files by DropBoxRest API in C#

Hi

My goal is to get files by DropBoxRest API in C#
Here is my code

var options = new Options
    {
        ClientId = "", //App key
        ClientSecret = "", //App secret
        RedirectUri = "https://www.dropbox.com/1/oauth2/authorize"
    };

// Initialize a new Client (without an AccessToken)
var client = new Client(options);

// Get the OAuth Request Url
var authRequestUrl = await client.Core.OAuth2.AuthorizeAsync(access_token which generated in my account);

// TODO: Navigate to authRequestUrl using the browser, and retrieve the Authorization Code from the response
var authCode = ""; Which code have to be here ???

// Exchange the Authorization Code with Access/Refresh tokens
var token = await client.Core.OAuth2.TokenAsync(authCode); in this line occured the following error
  //An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll      

// Get account info
var accountInfo = await client.Core.Accounts.AccountInfoAsync();

Please give me an advice

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 2 hours ago
334 Following

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 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!