The only lib required is Guzzle, PHP HTTP client.
composer require ems-encrypt/ems-encrypt-php-client
This PHP client lib was generated using the openapi.json file located in the root directory. Copy this file content in editor.swagger.io to see all the possibilities.
ems-api uses OAuth2 access authentication.
The first parameter must be a valid access token. The second parameter is the API entry point url. The third one is optional and is an array of headers that will be apply to every requests of the internal Guzzle client, allowing to specify the accepted language for errors eg.
/** @var \EmsEncrypt\Api\ApiClient $apiClient */
$apiClient = new \EmsEncrypt\Api\ApiClient(
$token,
'https://ems-encrypt-entry-point.tld',
['Accept-Language' => 'en']
);
Handle resources requesting with the main API client object like this :
/** @var \EmsEncrypt\Api\Resources\UserResponse $userResponse */
$userResponse = $apiClient->MeManager()->getUser();
/** @var \EmsEncrypt\Api\Resources\User $me */
$me = $userResponse->data;
More documentation to come with the first release...
Features to come :
- Link to the main documentation