jedgard
jedgard

Reputation: 868

Dropbox integration

I am new to integrating drop box, but I am not quite sure how to generate a call to get the request token secret.

https://www.dropbox.com/developers/reference/api#request-token

I have to make a call to this url https://api.dropbox.com/1/oauth/request_token what is the best way to do this? with c#?.

Thank you for any help you may provide

PS: I am just not sure which c# libraries to use for this.

Upvotes: 7

Views: 13002

Answers (3)

Alexander Schimpf
Alexander Schimpf

Reputation: 2392

Something like the following should work:

System.Net.WebClient client = new System.Net.WebClient();
string response = client.DownloadString("https://api.dropbox.com/1/oauth/request_token"); // Add necessary query parameters

// Parse the response
System.Collections.Specialized.NameValueCollection collection = System.Web.HttpUtility.ParseQueryString(response);

I included the namespaces to clarify the location of each class, but you should probably just put using directives at the top of your file.

Upvotes: 2

MNGwinn
MNGwinn

Reputation: 2394

System.Net.WebRequest is the class you want. Specifically, you'll need to call Create() with the URL and then call GetResponse() to read the result.

Upvotes: 0

Surfbutler
Surfbutler

Reputation: 1528

There's a .Net Dropbox library on Codeplex which looks quite good: http://sharpbox.codeplex.com/

Upvotes: 3

Related Questions