I want to to sync user dropbox account with our website so that user can directly upload their documents from our site.I am using Dotnet and had done following code
string appkey = ConfigurationManager.AppSettings.Get("Appkey").ToString();
string appSecret = ConfigurationManager.AppSettings.Get("AppSecret").ToString();
string returnUrl = ConfigurationManager.AppSettings.Get("ReturnUrl").ToString();
var client = new DropboxClient(appkey, appSecret);
var a = client.AccessToken;
client.ReturnUrl = returnUrl;
client.RedirectToAuthorization();
It correctly redirect me to dropbox login form and after allowing permission it send back to redirect URl with parameters state and code in query string ,but when I try to use code as access token while uploading file it give error of invalid token.
Am I doing something wrong,is code that is return is not the access token,if not then how can i get the access token from it.Please remember that i am using asp.net c#