Instagram-PHP-API icon indicating copy to clipboard operation
Instagram-PHP-API copied to clipboard

getUserMedia fails on private profil

Open Danetag opened this issue 10 years ago • 6 comments

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!

Danetag avatar May 16 '14 17:05 Danetag

Hello

still not work for me

any help ??

thnx

Q8HMA-zz avatar Jan 13 '15 08:01 Q8HMA-zz

Any update on this?

s8nv5a9m avatar Jul 02 '15 21:07 s8nv5a9m

I have the same issue, i have the token from the user but can't view media. Any solution for that?

christoph-werker avatar Oct 17 '15 19:10 christoph-werker

@FrankyGP maybe you can post more info. error, or your code ?

bodva avatar Oct 18 '15 18:10 bodva

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
        )

)

christoph-werker avatar Oct 19 '15 09:10 christoph-werker

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...

christoph-werker avatar Oct 19 '15 09:10 christoph-werker