1. Go to this page and download the library: Download imper86/php-immi-api 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/ */
imper86 / php-immi-api example snippets
use Http\Client\Common\Plugin\ErrorPlugin;
use Imper86\ImmiApi\Immi;
use Imper86\ImmiApi\Model\Credentials;
use Imper86\ImmiApi\Oauth\FileTokenRepository;
use Imper86\ImmiApi\Plugin\AuthPlugin;
$sandbox = true; //if set to false you will connect to production environment
$credentials = new Credentials(
'your_client_id',
'your_client_secret',
null,
$sandbox
);
$client = new Immi($credentials);
/*
* You can invent your own TokenRepository, just implement
* our TokenRepositoryInterface.
* You can use your DB, Redis, or anything you want.
* For this example we use _toString(), true));