PHP code example of andyhartley / oauth2-instagram

1. Go to this page and download the library: Download andyhartley/oauth2-instagram library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

andyhartley / oauth2-instagram example snippets


$newAccessToken = $provider->getLongLivedToken([
    'access_token' => $accessToken->getToken(), // this must be a short lived token
]);

$newAccessToken = $provider->refreshLongLivedToken([
    'access_token' => $accessToken->getToken(), // this must be a long lived token that is older than 1 day, and no older than 60 days
]);