1. Go to this page and download the library: Download tims/shiprocket-php-sdk 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/ */
tims / shiprocket-php-sdk example snippets
use Tims\Shiprocket\ShiprocketClient;
$shiprocket = ShiprocketClient::fromCredentials(
getenv('SHIPROCKET_EMAIL'),
getenv('SHIPROCKET_PASSWORD'),
);
use Tims\Shiprocket\AccessTokenGenerator;
use Tims\Shiprocket\ApiClient;
use Tims\Shiprocket\ShiprocketClient;
$token = (new AccessTokenGenerator())
->credentials($email, $password)
->getAccessToken();
$api = new ApiClient();
$api->setAccessToken($token);
$shiprocket = new ShiprocketClient($api);