Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
AndyLei
4 years agoExplorer | Level 4
Help with generating access tokens in Node.js
I am new to using https in Node.js, and Dropbox API, and am not familiar with the syntax. I have had no success finding Javascript examples on how to get an access token from a refresh token, and am ...
Здравко
4 years agoLegendary | Level 20
- AndyLei4 years agoExplorer | Level 4
I appreciate pointing it out. I have changed to the following after some searching, and now works as intended
import * as https from "https"; const req = https.request("https://api.dropbox.com/oauth2/token",{ method: "POST", headers:{ "Authorization":`Basic ${Buffer.from(`${<APP_KEY>}:${<SECRET_KEY>}`).toString("base64")}`, "Content-Type":"application/x-www-form-urlencoded" } }, (res) => { res.on("data", function(rawdat){ console.log(rawdat.toString()); }) }); req.write(new URLSearchParams({ grant_type:"refresh_token", refresh_token: <REFRESH_TOKEN> }).toString()); req.end();
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!