galen / PHP-Instagram-API

PHP 5.3+ wrapper for the Instagram API
337 stars 116 forks source link

Check if access token is valid? #22

Closed ahansson89 closed 11 years ago

ahansson89 commented 11 years ago

Is there any way of checking if access token is valid?

Would love something like this: $instagram->isAccessTokenValid($access_token);

Right now I am in a situation where I cannot get accesstoken through oauth2 and if the access token for some reason is not valid, then I get the exceptions thrown.

galen commented 11 years ago

If authentication is bad it throws an ApiAuthException. You can also just catch the generic ApiException and use ApiException->getType to check for an authentication error.

ahansson89 commented 11 years ago

Cool. I got it working! Thanks.

Great stuff you built here! :+1: :)

rthakur commented 10 years ago

How can i get access token value ?

I had used this code

$instagram = new Instagram\Instagram; $instagram->setAccessToken('0b07916bffec46ff8535d5137c9aa231');

rohan0906 commented 10 years ago

ahansson89 can you please elaborate it.

rthakur commented 10 years ago

Thanks for reply , now issue fixed.