All URIs are relative to ///shipping/v3
Method | HTTP request | Description |
---|---|---|
authenticatePost | POST /token | Authenticates a User and provides token. |
authenticatePost($xRMGSecurityUsername, $xRMGSecurityPassword)
Authenticates a User and provides token.
Provides security token.
<?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');// Configure API key authorization: clientSecret
$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-Secret', 'Bearer');
$apiInstance = new RoyalMail\Shipping\Rest\TokenApi(
// 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
);
$xRMGSecurityUsername = "xRMGSecurityUsername_example"; // string | User Name
$xRMGSecurityPassword = "xRMGSecurityPassword_example"; // string | Password in plain text
try {
$apiInstance->authenticatePost($xRMGSecurityUsername, $xRMGSecurityPassword);
} catch (Exception $e) {
echo 'Exception when calling TokenApi->authenticatePost: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
xRMGSecurityUsername | string | User Name | |
xRMGSecurityPassword | string | Password in plain text |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json, application/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]