POST instagram api follow with cURL PHP -
¡hi!
i'm trying post instagram api. have 1 random valid access_token , i'm trying follow access_token using php , curl, possible?
my php code:
$ch = curl_init(); // set url , other appropriate options curl_setopt($ch, curlopt_url,"https://api.instagram.com/v1/users/<userid>/relationship?access_token=<valid access_token>"); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, 'action=follow'); // grab url , pass browser $result = curl_exec($ch); // close curl resource, , free system resources curl_close($ch); print_r($result);
and error:
{"code": 403, "error_type": "oauthforbiddenexception", "error_message": "invalid header: x-insta-forwarded-for required operation"}
i read can actions (follow, like) access_token, truth?
thanks!
you might have enabled enforce signed requests instagram client app. need make request signed header. more details visit following https://instagram.com/developer/restrict-api-requests/ . there mentioned common responses signed requests. should use access_token endpoints. , trying make post request, before making post request make sure have permission make post request on endpoint. reason response, header missing {"code": 403, "error_type": "oauthforbiddenexception", "error_message": "invalid header: x-insta-forwarded-for required operation"}
Comments
Post a Comment