We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
AndyLei
3 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 ...
Здравко
Legendary | Level 20
AndyLei
3 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.
5,877 PostsLatest Activity: 12 months agoIf 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 or Facebook.
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!