We are going to deploy the new yiiframework.com website on March 23, 2018 from 8:00 to 12:00 UTC.
Website and Yii documentation will not be available in this time frame. Check the news for more details.

Yii 1.1: yiinstagram

Bring the Instagram's experience on your Yii powered webapp

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


  • Copy the extension content in your extension/yiinstagram folder
  • Create your Instagram App on http://instagr.am/developer/clients/manage/
  • Add the configuration of your client in the Component section of your config file
'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();              

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();
    $instagramUser = $instagram->getCurrentUser();

enojoy asking Instagram API's whatever you want


Be the first person to leave a comment

Please to leave your comment.

Create extension