I'm trying to use instagram api to show #'s on my webpage but i need to generate user token for instagram tester. I followed the documentatio (created an application, use my page url, sent invitation for instagram tester and accepted it) but when i click on generate token for instagram tester it displays a pop-up window to allow permissions, then it shows nothing. I tried with another account, creating a different application but the result is the same.
Facebook token generator seems to be broken, but you can generate your own long-lived access token following OAuth2 workflow (replace {}
placeholders with your own values):
https://api.instagram.com/oauth/authorize?client_id={your-client-id}&client_secret={your-client-secret}&redirect_uri={a-valid-redirect-url}&scope=user_profile,user_media&response_type=code
{a-valid-redirect-url}?code=xxxxx#_
then copy to {code} query string value without the #_
at the endPOST
request to https://api.instagram.com/oauth/access_token
with x-www-form-urlencoded
params
client_id
: {your-client-id}client_secret
: {your-client-secret}grant_type
: authorization_coderedirect_uri
: {a-valid-redirect-url}code
: {the code you extracted from query string}{
"access_token": "IGQVxxxxxxxxxx…",
"user_id": xxxxxxxxxx
}
GET
request to https://graph.instagram.com/access_token
with query params:
client_id
: {your-client-id}client_secret
: {your-client-secret}grant_type
: ig_exchange_tokenaccess_token
: {the short-lived access_token}{
"access_token": "IGQxxxxx…",
"token_type": "bearer",
"expires_in": 5169852
}