PHP code example of mnib-dev / urgentcargus

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

    

mnib-dev / urgentcargus example snippets


$client = new \MNIB\UrgentCargus\Client($apiKey, $apiUri);
$client->createAccessToken('username', 'password');

$result = $client->get('PickupLocations');

$params = [
    'Sender' => [],
    'Recipient' => [],
    'Parcels' => 1,
    'TotalWeight' => 1,
    'DeclaredValue' => 1000,
    'CashRepayment' => 1000,
    'BankRepayment' => 0,
    'OpenPackage' => true,
    'SaturdayDelivery' => false,
    'PackageContent' => 'awb content',
    'CustomString' => $orderId,
];
$awbId = $client->post('Awbs', $params);