1. Go to this page and download the library: Download smartsendio/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/ */
smartsendio / api example snippets
$client = new Smartsendio\Api\Adapters\GuzzleClientAdapter(new \GuzzleHttp\Client());
$api = new Smartsendio\Api\ApiFactory($client); // Any client that implements ClientInterface can be used
$api->apiToken('API_TOKEN_HERE')->website('WEBSITE'); // Set the authentication parameters
$api->demo(); // Api is now in demo mode.
// Example: All agents for a given carrier in a zipcode
$response = $api->agents() // AgentApiInterface
->carrier('postnord')
->country('DK')
->zipcode('2100')
->get(); // PaginatedAgentApiResponseInterface
// Example: The closest agents for a given carrier based on a given address
$response = $api->agents() // AgentApiInterface
->carrier('postnord')
->country('DK')
->zipcode('2100')
->street('Nordre Frihavnsgade 1')
->closest(); // PaginatedAgentApiResponseInterface
// Example: Get a single agent using the carries own unique agent number
$response = $api->agents() // AgentApiInterface
->carrier('postnord')
->country('DK')
->lookup('1234567'); // AgentApiResponseInterface
$response = $api->booking()->shipment($shipment); // ApiResponseInterface
$response->isSuccessful(); // false
$error = $response->getError(); // ApiErrorInterface
$error->getId(); // Unique id of the error
$error->getCode(); // Error code describing the type of error
$error->getMessage(); // Description of the error
$error->getErrors(); // Return each individual error
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.