PHP code example of deliverymatch / api-library

1. Go to this page and download the library: Download deliverymatch/api-library 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/ */

    

deliverymatch / api-library example snippets


use DeliveryMatchApiLibrary\DeliveryMatchClient;

$api = new DeliveryMatchClient($_SERVER["CLIENT_ID"], $_SERVER["API_KEY"], $_SERVER["URL"]);

$requestData = [
    "shipment" => [
        "id" => 12345678
    ]
]

try {
    $api->sendRequest("getShipment", $requestData)''
} catch (DeliveryMatchException $e) {
    // handle error
}