A simple client that let's you connect and integrate your application with Instagram and make every API call. Your users will be able to connect and login to your site using their Instagram. Built over the very nice (and complete) Instagram PHP Implementation API by Mauricio Cuenca.
Yii 1.1 or above
'instagram' => array( 'class' => 'ext.yiinstagram.InstagramEngine', 'config' => array ( 'client_id' => 'YOUR_CLIENT_ID', 'client_secret' => 'YOUR_CLIENT_SECRET', 'grant_type' => 'authorization_code', 'redirect_uri' => 'YOUR_CALLBACK_URL', ) )
start the authentication in your desired controller/action simply doin this:
$instagram = Yii::app()->instagram->getInstagramApp(); $instagram->openAuthorizationUrl();
then in your callback url verifiy if the user has been redirect with the code parameter set
if (isset($_GET['code'])) { $session = Yii::app()->getSession(); $accessToken = $instagram->getAccessToken(); $instagram->setAccessToken($accessToken); $instagramUser = $instagram->getCurrentUser(); ....
enojoy asking Instagram API's whatever you want
Be the first person to leave a comment
Please login to leave your comment.