Responses
Darko Gjorgjijoski edited this page Aug 28, 2021
·
2 revisions
The API client provides Response classes that can be used to extract the API response.
There are two type of responses, one is Result
and the other is Error
.
The following example outlines how to properly handle the API responses.
use IdeoLogix\DigitalLicenseManagerClient\Http\Responses\Result;
use IdeoLogix\DigitalLicenseManagerClient\Http\Responses\Error;
if( $response instanceof Error ) {
print_r( $response->get_code() );
print_r( $response->get_message() );
} else {
print_r( $response->get_data() );
}