A PHP wrapper for interacting with CBR Top Webservices API and supports the AuthenticationService, ReservationService, ReferenceDataService. This way you are able to handle the following operations:
- Submitting a new application or changing an existing application;
- Requesting open applications;
- Request previously purchased capacity via TOP;
- Reservation of requests at own capacity;
- Requesting the results;
- Request reference data such as the permitted products and locations, your registered instructors, your agreements with other trainers, and the available languages of the products;
- Changing the password;
You can install the package via composer:
composer require metmax-io/cbr-api-php
Create the environment file
cp .env.dist .env
The API consists of 3 endpoints:
- Authentication
- ReferenceData
- Reservation
The API's are separated in different folders but can be used similarly.
use MetMax\Cbr\ReferenceData\ReferenceDataClientFactory;
use MetMax\Cbr\ReferenceData\Type\LocationsRequest;
$referenceData = ReferenceDataClientFactory::factory('username', 'password');
$locations = $referenceData->getLocations(new LocationsRequest());
The package php-http/vcr-plugin is being used to mock SOAP calls towards the CBR API. Responses will be stored inside the fixtures/vcr/ directory.
When a fixture isn't available, an actual HTTP call will be initiated, while the response will be stored as a fixture. If you want to update existing fixtures or creating new endpoints, make sure that the API credentials are configured within the .env file.
Run full testsuite
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.