I am using instagram API(oauth) and I able to get the access token and user information using
https://api.instagram.com/oauth/authorize/client_id='.$client_id.'&redirect_uri='.$redirect_url .'&response_type=code'
and https://api.instagram.com/oauth/access_token by passing client id, secret and redirect_uri.
when I make the first call
(https://api.instagram.com/oauth/authorize/client_id='.$client_id.'&redirect_uri='.$redirect_url .'&response_type=code') it gives me the array of access_token and user.
My question is what should I do to get the followers of the user ?
I know I have to use https://api.instagram.com/v1/users/{user-id}/follows?access_token=ACCESS-TOKEN but for some reason I am getting the error message
{
"code": 400,
"error_type": "OAuthException",
"error_message": "Only response type \"code\" and \"token\" is allowed"
}
Please help!!!
Firstly, you don't need to be authenticated (i.e. need an
access_token) to get a list of user followers. You just need yourclient_id.The following request should work in your case:
https://api.instagram.com/v1/users/{user-id}/follows/?client_id={client_id}