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 780 forks source link

Access-Token | The access_token provided is invalid. #222

Open dahormez opened 8 years ago

dahormez commented 8 years ago

Session saved Access-token, getUser works all other functions not. Please help ;-)

cbenjamin commented 8 years ago

Having this exact same problem... heard any updates?

robertrimke commented 8 years ago

Also the same issue... any help??? EDIT: This Works: https://github.com/cosenary/Instagram-PHP-API/pull/191/commits/484c974a1aae001f538ad354a004c354dd492ae5

subasah commented 7 years ago

Experiencing the same problem. Is there any solution.. or update??

marko85to commented 7 years ago

Same Issue. I tried to apply the update 484c974 mentioned above but it doesn't seem to solve anything. Any solution?

tsukasa1989 commented 7 years ago

The issue is that in __construct the setApiKey should be setAccessToken. Should be like this:

if (is_array($config)) {
        // if you want to access user data
        $this->setApiKey($config['apiKey']);
        $this->setApiSecret($config['apiSecret']);
        $this->setApiCallback($config['apiCallback']);
    } elseif (is_string($config)) {
        // if you only want to access public data
        $this->setAccessToken($config); // Change here
    } else {
        throw new InstagramException('Error: __construct() - Configuration data is missing.');
    }