RetailCRM API Client

Features extends AbstractApiResourceGroup

Class Features

Tags
category

Features

SuppressWarnings

(PHPMD.CouplingBetweenObjects)

Table of Contents

Methods

check()  : FeaturesCheckResponse
Makes GET "/api/v5/features/check" request.

Methods

check()

Makes GET "/api/v5/features/check" request.

public check([FeaturesCheckRequest|null $request = null ]) : FeaturesCheckResponse

Example:

use RetailCrm\Api\Factory\SimpleClientFactory;
use RetailCrm\Api\Interfaces\ApiExceptionInterface;
use RetailCrm\Api\Model\Request\Api\FeaturesCheckRequest;

$client = SimpleClientFactory::createClient('https://test.retailcrm.pro', 'apiKey');

$request = new FeaturesCheckRequest()
$request->features = ['communication.chatbot_feature_1', 'communication.chatbot_feature_2']

try {
    $response = $client->features->check($request);
} catch (ApiExceptionInterface $exception) {
    echo sprintf(
       'Error from RetailCRM API (status code: %d): %s',
        $exception->getStatusCode(),
        $exception->getMessage
    );

    if (count($exception->getErrorResponse()->errors) > 0) {
        echo PHP_EOL . 'Errors: ' . implode(', ', $exception->getErrorResponse()->errors);
    }

     return;
}

echo 'System features ' . print_r($response->features, true);
Parameters
$request : FeaturesCheckRequest|null = null
Tags
throws
ApiExceptionInterface
throws
ClientExceptionInterface
throws
AccountDoesNotExistException
throws
ApiErrorException
throws
MissingCredentialsException
throws
MissingParameterException
throws
ValidationException
throws
HandlerException
throws
HttpClientException
Return values
FeaturesCheckResponse

        
On this page

Search results