Join the Conversation: The Dash Community Is Now Open! ✨🎉
Forum Discussion
vignesh p.
11 years agoNew member | Level 1
Dropbox Sync API access token
How to get access token from the DBAccountManager.SharedManager.HandleOpenURL("url") using dropnet ? or any other alternative way to get the access token
6 Replies
Replies have been turned off for this discussion
- Steve M.11 years ago
Dropbox Staff
When you say "dropnet," are you referring to the .NET library (https://github.com/DropNet/DropNet)?
If you're migrating from the Sync API, take a look at https://blogs.dropbox.com/developers/2015/05/migrating-sync-sdk-access-tokens-to-core-sdk/ for details about how to extract the existing access token.
- vignesh p.11 years agoNew member | Level 1
Yes I'm referring to this (https://github.com/DropNet/DropNet) only ,I use the following code but I'm getting an weird exception "Object reference not set to an instance of an object"
string apikey = dropvalues.DropboxApiKey; string apisecretkey = dropvalues.DropboxApiSecretKey; string usertoken = dropvalues.DropBoxUserToken; string usersecrettoken = dropvalues.DropBoxUserSecretKey; DropNetClient client = new DropNetClient(apikey, apisecretkey, usertoken, usersecrettoken); // client.GetTokenAndBuildUrl(uri); var accesskey = client.GetAccessToken(); Debug.WriteLine("Access key is " + accesskey); - Steve M.11 years ago
Dropbox Staff
What object reference is not set to an instance of an object?
Also, cross-referencing your post on Stack Overflow: http://stackoverflow.com/questions/30366944/how-to-get-access-token-from-dropbox-sync-datastore-xamarin-component.
- vignesh p.11 years agoNew member | Level 1
I have resolved the object reference exception now i got this one
DropBoxIntegration[3831:508119] Stack Trace at DropNet.DropNetClient.Execute (ApiType apiType, IRestRequest request) [0x0002c] - vignesh p.11 years agoNew member | Level 1
In the following URL which is the access key
{db-XXXXXXX://1/connect?oauth_token_secret=XXXXXXXX&state=XXXXXXXXXXXXX&uid=XXXXXXX&oauth_token=XXXXXXXXXXX}?
- Steve M.11 years ago
Dropbox Staff
I'm not familiar with the term "access key," but if you're asking about an "access token," that's a term associated with OAuth 2, while the URL you have is dealing with OAuth 1. In OAuth 1, you get an token (
oauth_token) and a token secret (oauth_token_secret). If you need to convert that to an OAuth 2 access token, you can use the/token_from_oauth1endpoint.That said, I'm pretty sure the version of DropNet you're using only supports OAuth 1, so you should probably stick with the token and token secret that you have. (Your code looks good to me up until the call to
GetAccessToken.)
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!