Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
David S.309
10 years agoNew member | Level 1
Getting HTTP 401 on for access_token one some server
Hi guys,
We came across a strange issue, when trying to get a access token the the OAuth1 API, the successive calls to "request_token" and "authorize" are working fine, but its is time to access "h...
David S.309
10 years agoNew member | Level 1
Hi Gregory,
Thanks for your quick response:
We call to:
https://api.dropbox.com/1/oauth/access_token?oauth_consumer_key=sbbviyc3ydrd8n4&oauth_nonce=MTY5MDU3MDQ5MzY1MDk2OTYwMA==&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1452581278&oauth_token=UCrgcXsS1mbVjiKX&oauth_token_secret=YYYYY&oauth_version=1.0&oauth_signature=l0H7LPwqnAwwa1cEDhnJpCr13nQ%3D
The Request header:
| Accept | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| Accept-Encoding | gzip, deflate |
| Accept-Language | fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3 |
| Connection | keep-alive |
| Cookie | language=fr; _ga=GA1.2.148585141.1451996517; JSESSIONID=19B84D1F6D6592685286D7FF53B5071F |
| DNT | 1 |
| Host | ocrqa.iriscloud.irislink.com |
| Referer | https://www.dropbox.com |
| User-Agent |
|
The Response header:
| Connection | close |
| Content-Language | fr |
| Content-Length | 4241 |
| Content-Type | text/html;charset=utf-8 |
| Date | Tue, 12 Jan 2016 06:47:59 GMT |
| Server | Apache-Coyote/1.1 |
As we use a Java servlet to perform POST/GET, the issue arise when post to the URL above when trying to fetch the response:
Small code sample:
URL iurl = new URL(url);
HttpURLConnection uc = null;
uc = (HttpURLConnection) iurl.openConnection(Proxy.NO_PROXY);
uc.setAllowUserInteraction(true);
uc.setInstanceFollowRedirects(true);
uc.setUseCaches(false);
uc.setRequestProperty("Connection", "close");
uc.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)");
uc.setRequestMethod("POST");
uc.setDoOutput(false);
uc.connect();
Is that what you need ?
Br,
David
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!