cosenary / Instagram-PHP-API

An easy-to-use PHP Class for accessing Instagram's API.
http://cosenary.github.com/Instagram-PHP-API
BSD 3-Clause "New" or "Revised" License
1.46k stars 782 forks source link

getUserMedia fails on private profil #45

Open Danetag opened 10 years ago

Danetag commented 10 years ago

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!

Q8HMA-zz commented 9 years ago

Hello

still not work for me

any help ??

thnx

s8nv5a9m commented 9 years ago

Any update on this?

christoph-werker commented 8 years ago

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

bodva commented 8 years ago

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

christoph-werker commented 8 years ago

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 commented 8 years ago

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