1. Go to this page and download the library: Download artin/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/ */
php
// Get login url:
public function index(Instagram $instagram)
{
return $instagram->getLoginUrl();
// or Instagram::getLoginUrl();
}
// Get access token on callback, once user has authorized via above method
public function callback(Request $request, Instagram $instagram)
{
$response = $instagram->getAccessToken($request->code);
// or $response = Instagram::getAccessToken($request->code);
if (isset($response['code']) == 400)
{
throw new \Exception($response['error_message'], 400);
}
return $response['access_token'];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.