A PHP library for accessing the Royal Mail Tracking API V2 (REST) API.
MIT License
Adds optional parameter for specifying the base API endpoint, eg:
$tracking = (new \ElliotJReed\RoyalMail\Tracking\Events(
new \GuzzleHttp\Client(),
'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
'12345678901234567890123456789012345678901234567890',
true, // Optional, when true (default: true) exceptions will be thrown for tracking errors
true, // Optional, when true (default: true) exceptions will be thrown for technical (eg. 500 HTTP response) errors
'https://api.royalmail.net/mailpieces/v2' // Optional, when set the default API endpoint can be overridden (default: 'https://api.royalmail.net/mailpieces/v2')
));
$signature = (new \ElliotJReed\RoyalMail\Tracking\Signature(
new \GuzzleHttp\Client(),
'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
'12345678901234567890123456789012345678901234567890',
true, // Optional, when true (default: true) exceptions will be thrown for tracking errors
true, // Optional, when true (default: true) exceptions will be thrown for technical (eg. 500 HTTP response) errors
'https://api.royalmail.net/mailpieces/v2' // Optional, when set the default API endpoint can be overridden (default: 'https://api.royalmail.net/mailpieces/v2')
));
$summary = (new \ElliotJReed\RoyalMail\Tracking\Summary(
new \GuzzleHttp\Client(),
'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
'12345678901234567890123456789012345678901234567890',
true, // Optional, when true (default: true) exceptions will be thrown for tracking errors
true, // Optional, when true (default: true) exceptions will be thrown for technical (eg. 500 HTTP response) errors
'https://api.royalmail.net/mailpieces/v2' // Optional, when set the default API endpoint can be overridden (default: 'https://api.royalmail.net/mailpieces/v2')
));
Published by elliotjreed 7 months ago
Fixes exception getResponse()
return type to allow null
Published by elliotjreed over 1 year ago
Sets minimum required PHP version to 8.1 (PHP 8.0 no longer supported).
Published by elliotjreed over 1 year ago