All URIs are relative to ///shipping/v3
Method | HTTP request | Description |
---|---|---|
addressesCreate | POST /addresses | Create Address |
addressesDelete | DELETE /addresses/{addressId} | Delete Address |
addressesGet | GET /addresses/{addressId} | Get Address |
addressesGetAll | GET /addresses | Get Addresses |
addressesUpdate | PUT /addresses/{addressId} | Update address |
\RoyalMail\Shipping\Rest\Api\models\AddressResponse addressesCreate($body, $xRMGAuthToken)
Create Address
Add a new address to your address book that you can then use in your shipment requests.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// 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\AddressesApi(
// 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 required to invoke this operation. Can be retrieved by invoking the **_/token** operation.
try {
$result = $apiInstance->addressesCreate($body, $xRMGAuthToken);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->addressesCreate: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \RoyalMail\Shipping\Rest\Api\models\Address | The address. | |
xRMGAuthToken | string | Authorisation token required to invoke this operation. Can be retrieved by invoking the _/token operation. |
\RoyalMail\Shipping\Rest\Api\models\AddressResponse
- Content-Type: application/xml, application/json
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\RoyalMail\Shipping\Rest\Api\models\AddressResponse addressesDelete($xRMGAuthToken, $addressId)
Delete Address
Deletes the specified address.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// 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\AddressesApi(
// 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 required to invoke this operation. Can be 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;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
xRMGAuthToken | string | Authorisation token required to invoke this operation. Can be retrieved by invoking the _/token operation. | |
addressId | string | Your unique Address ID of the address to delete. |
\RoyalMail\Shipping\Rest\Api\models\AddressResponse
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\RoyalMail\Shipping\Rest\Api\models\Address addressesGet($xRMGAuthToken, $addressId)
Get Address
Get the address specified by your unique Address ID.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// 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\AddressesApi(
// 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 required to invoke this operation. Can be retrieved by invoking the **_/token** operation.
$addressId = "addressId_example"; // string | Your unique Address ID.
try {
$result = $apiInstance->addressesGet($xRMGAuthToken, $addressId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->addressesGet: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
xRMGAuthToken | string | Authorisation token required to invoke this operation. Can be retrieved by invoking the _/token operation. | |
addressId | string | Your unique Address ID. |
\RoyalMail\Shipping\Rest\Api\models\Address
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\RoyalMail\Shipping\Rest\Api\models\Address[] addressesGetAll($xRMGAuthToken)
Get Addresses
Get all of your stored addresses
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// 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\AddressesApi(
// 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 required to invoke this operation. Can be retrieved by invoking the **_/token** operation.
try {
$result = $apiInstance->addressesGetAll($xRMGAuthToken);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->addressesGetAll: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
xRMGAuthToken | string | Authorisation token required to invoke this operation. Can be retrieved by invoking the _/token operation. |
\RoyalMail\Shipping\Rest\Api\models\Address[]
- Content-Type: Not defined
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\RoyalMail\Shipping\Rest\Api\models\AddressResponse addressesUpdate($body, $xRMGAuthToken, $addressId)
Update address
Update an address that is already in your address book with new details. The whole address will be replaced with
new details.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// 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\AddressesApi(
// 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 with the updated details.
$xRMGAuthToken = "xRMGAuthToken_example"; // string | Authorisation token required to invoke this operation. Can be retrieved by invoking the **_/token** operation.
$addressId = "addressId_example"; // string | Your unique Address ID of the address to update.
try {
$result = $apiInstance->addressesUpdate($body, $xRMGAuthToken, $addressId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->addressesUpdate: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \RoyalMail\Shipping\Rest\Api\models\Address | The address with the updated details. | |
xRMGAuthToken | string | Authorisation token required to invoke this operation. Can be retrieved by invoking the _/token operation. | |
addressId | string | Your unique Address ID of the address to update. |
\RoyalMail\Shipping\Rest\Api\models\AddressResponse
- Content-Type: application/xml, application/json
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]