Each 3 months, there's a need to revalidate and change the Instagram token.
CLIENT_ID = Instagram App ID - Basic display CLIENT_SECRET = Instagram App secret
-
Authenticate test user - [GET]
https://api.instagram.com/oauth/authorize?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URL}&scope=user_profile,user_media&response_type=code
-
Exchange the Code for a short-lived token - [POST]
https://api.instagram.com/oauth/access_token
client_id
: Instagram app IDclient_secret
: Instagram app secretgrant_type
:authorization_code
redirect_uri
code
: code (response) from step 4 (withouth hashtah and underscore)
-
Get a long-lived token - [GET]
https://graph.instagram.com/access_token?grant_type=ig_exchange_token&client_secret={IG_APP_SECRET}&access_token={SHORT_LIVED_TOKEN}
-
Refresh a long-lived token - [GET]
https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token={LONG_LIVED_TOKEN}
(when long-lived token expired, need to go all the way from the start)