Instagram-PHP-API
Instagram-PHP-API copied to clipboard
getUserMedia fails on private profil
Hello!
Your getUserMedia() method is currently doing wrong. It should provide an access_token for the request.
public function getUserMedia($id = 'self', $limit = 0) { return $this->_makeCall('users/' . $id . '/media/recent', true, array('count' => $limit)); }
It drove me crazy for a couple of hours, as I provided scopes and a token...
Thank you!
Hello
still not work for me
any help ??
thnx
Any update on this?
I have the same issue, i have the token from the user but can't view media. Any solution for that?
@FrankyGP maybe you can post more info. error, or your code ?
Here is some Code Snippet. My Account with the Developer Account has send an Request to see the Profile an can see all Pictures from hin, but my Api don't.
$token = '395388810.1d63152.5614ab1f8cef4XXXXXXXXXXXXXX'
$instagramId = '39538XXXX';
$code = $token;
$instagram->setAccessToken($code);
$result = $instagram->getUserMedia($instagramId,25);
die(print_r($result));
// This error appears.
(
[meta] => stdClass Object
(
[error_type] => APINotAllowedError
[code] => 400
[error_message] => you cannot view this resource
)
)
go a Solution in Instagram.php
public function getUserMedia($id = 'self', $limit = 0) {
return $this->_makeCall('users/' . $id . '/media/recent', true, array('count' => $limit));
}
http://stackoverflow.com/questions/23701131/getting-apinotallowederror-when-requesting-medias-on-a-private-profil-even-wi
Could it be, that i've got not the current version? my composer says, that i've got the newest version. But the https://github.com/cosenary/Instagram-PHP-API/blob/master/src/Instagram.php is different to my Code...