<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zvps / royal-mail-shipping-rest-api-client example snippets
onfigure API key authorization: clientID/Secret
$config = RoyalMail\Shipping\Rest\Api\Configuration::getDefaultConfiguration()->setApiKey('X-IBM-Client-Id', 'YOUR_API_KEY');
$config = RoyalMail\Shipping\Rest\Api\Configuration::getDefaultConfiguration()->setApiKey('X-IBM-Client-Secret', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = RoyalMail\Shipping\Rest\Api\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-IBM-Client-Id', 'Bearer');
$apiInstance = new RoyalMail\Shipping\Rest\ApiAddressesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \RoyalMail\Shipping\Rest\Api\models\Address(); // \RoyalMail\Shipping\Rest\Api\models\Address | The address.
$xRMGAuthToken = "xRMGAuthToken_example"; // string | Authorisation token retrieved by invoking the **_/token** operation.
$addressId = "addressId_example"; // string | Your unique Address ID of the address to delete.
try {
$result = $apiInstance->addressesDelete($xRMGAuthToken, $addressId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->addressesDelete: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: clientID
$config = RoyalMail\Shipping\Rest\Api\Configuration::getDefaultConfiguration()->setApiKey('X-IBM-Client-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = RoyalMail\Shipping\Rest\Api\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-IBM-Client-Id', 'Bearer');
$apiInstance = new RoyalMail\Shipping\Rest\ApiAddressesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$xRMGAuthToken = "xRMGAuthToken_example"; // string | Authorisation token address with the updated details.
$xRMGAuthToken = "xRMGAuthToken_example"; // string | Authorisation token
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.