Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
sobharaj m.
11 years agoNew member | Level 1
URL Unauthorized access error while accessing files from dropbox?
we are accessing having a problem in URL we have a file named xyx (1).jpg while passing this to server we are getting response as Unauthorized Access. May I Know how to pass this request to Server? ...
Steve M.
Dropbox Staff
11 years agoI'm not sure what's going wrong in your code, so I thought I'd instead provide some working code I wrote for you. The method below returns the full URI to download a thumbnail from Dropbox.
Note that I'm not using OAuthBase.GenerateSignature. That method returns a URL-encoded version of the signature, which I found hard to work with. Because we're using PLAINTEXT signing, it's very easy to construct the signature yourself. It's just the app secret, then an ampersand (&), and then the token secret.
static Uri GetThumbnailUri(string path, string appKey, string appSecret, string token, string tokenSecret) {
var oauthBase = new OAuth.OAuthBase();
var ub = new UriBuilder(@"https://api-content.dropbox.com/1/thumbnails/auto/" + path.TrimStart('/'));
// get an empty HttpValueCollection
var parameters = HttpUtility.ParseQueryString(string.Empty);
// add all the OAuth parameters
parameters["oauth_consumer_key"] = appKey;
parameters["oauth_token"] = token;
parameters["oauth_nonce"] = oauthBase.GenerateNonce();
parameters["oauth_timestamp"] = oauthBase.GenerateTimeStamp();
parameters["oauth_version"] = "1.0";
parameters["oauth_signature_method"] = "PLAINTEXT";
parameters["oauth_signature"] = appSecret + "&" + tokenSecret;
// set the query string for the URL
ub.Query = parameters.ToString();
return ub.Uri;
}
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!