The access_token provided is invalid.
Приложение в режиме сандбокс. Получаю личную информацию по текущему токену(фото профиля, id, имя и т.п.)
/*****************************************************************/
$token = $query['access_token'];
$user_id = $query['user_id'];
$instagram_cnct = curl_init();
curl_setopt( $instagram_cnct, CURLOPT_URL, "https://api.instagram.com/v1/users/" . $user_id . "/media/recent?access_token=" . $token );
curl_setopt( $instagram_cnct, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $instagram_cnct, CURLOPT_TIMEOUT, 15 );
$media = json_decode( curl_exec( $instagram_cnct ) );
curl_close( $instagram_cnct );
print_r($media);
$limit = 4;
$size = 200;
foreach(array_slice($media->data, 0, $limit) as $data) {
echo '<a href="' . $data->link . '" target="_blank">';
echo '<img src="'. $data->images->low_resolution->url . '" height="'.$size.'" width="'.$size.'"/>';
echo '</a>';
}
/*****************************************************************/