Created
July 29, 2021 10:04
-
-
Save bibhuticoder/b7f8c46d5b802f81af07b52c204df067 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
let oldAccessToken = "XXXXX"; // get from DB | |
let resp = await axios.get(`https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=${oldAccessToken}`) | |
if (resp.data.access_token) { | |
let newAccessToken = resp.data.access_token; | |
// save newAccessToken to DB | |
} | |
} catch (e) { | |
console.log("Error=====", e.response.data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment