Acquia Personalization API Client for PHP
Provides an API client for PHP applications communicating with the Acquia Personalization API .
Installation
Install the latest version with Composer:
$ composer require acquia/perz-api-php
Usage
Create the API Client
use Acquia\PerzApiPhp\ObjectFactory;
use Acquia\PerzApiPhp\PerzApiPhpClient;
$base_uri = 'https://personalization.api.endpoint';
$api_key = 'XXXXXX';
$secret_key = 'XXXXXXXXXXXXXXXX';
$key = ObjectFactory::getAuthenticationKey($api_key, $secret_key);
$middleware = ObjectFactory::getHmacAuthMiddleware($key);
$config = ['base_url' => $base_uri];
$api_client = new PerzApiPhpClient($middleware, $config);
Create entities in Personalization
$response = $api_client->putVariations($data);
Delete entities from Personalization.
$response = $api_client->getEntities($data);
Get entities from Personalisation.
<?php
$response = $api_client->getEntities($data);