Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Garnik G.
11 years agoExplorer | Level 4
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
19 Replies
- Garnik G.11 years agoExplorer | Level 4
I totally agree with you. But others users can't have an access to our access_token because they have to use only exe.
- Steve M.11 years ago
Dropbox Staff
If the access token is in the exe file, it can definitely be extracted. (As a potentially easier alternative, a user could just set up an HTTP proxy and look at the Authorization header.)
- Garnik G.11 years agoExplorer | Level 4
Thank you for the answer.
Can you please explain thisAs a potentially easier alternative, a user could just set up an HTTP proxy and look at the Authorization header
- Steve M.11 years ago
Dropbox Staff
I mean that if a user wants to get the access token, they can just run an HTTP proxy (like Fiddler2) and see the Authorization header your app is sending to Dropbox. The access token will be plainly visible there.
My general point is that if you put the access token in the app, users can get it.
- Garnik G.11 years agoExplorer | Level 4
Thanks. Ok. So what you advice ? how we can use dropbox in this case?
- Steve M.11 years ago
Dropbox Staff
My advice would be to not use Dropbox. The Dropbox API is primarily meant to be used in apps where each user will access his or her own account.
- Garnik G.11 years agoExplorer | Level 4
Thanks. But I have no choice to create new API and I have no other server. So I don't know what can I do except of DropBox
- Velmurugan N.10 years agoNew member | Level 1
hi All
I.m getting the following error
Dropbox Rest API.Services.Core.OAuth2 does not contain definition for AuthorizeAsync
- Steve M.10 years ago
Dropbox Staff
Velmurugan, please post a new question instead of replying to an old thread.
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!