Answer the question
In order to leave comments, you need to log in
Using the Instagram API - modifyRelationship. Where is the mistake?
It is required to implement a subscription to the Instagram channel from an external resource. Based on the solution from here - https://github.com/cosenary/Instagram-PHP-API/wiki... At the output I get an error - "This request requires scope=relationships, but this access token is not authorized with this scope. The user must re-authorize your application with scope=relationships to be granted write permissions". Can anyone suggest what is wrong here?
require 'instagram.php';
$instagram = new Instagram(array(
'apiKey' => 'f3e0382a0d004cfabbb8d2e0d2965296',
'apiSecret' => 'cf0f57e327634e78baee3164cb100587',
'apiCallback' => 'http://localhost/insta/follow.php'
));
$login = $instagram->getLoginUrl(array(
'basic',
'relationships'
));
echo "<a href='{$login}'>Login with Instagram</a><br><br>";
$code = $_GET['code'];
$token = $instagram->getOAuthToken($code, true);
$instagram->setAccessToken($token);
$result = $instagram->modifyRelationship('follow', 1993209855);
Answer the question
In order to leave comments, you need to log in
In order to perform actions by subscribing, likes, comments, you need to receive additional permission, while they consider the finished code so that they do not initially make robots
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question