Eziteq
, (*1)
A PHP 5.3+ wrapper for Eziteq API requests., (*2)
Installation
You can install EziteqAPI_PHP via composer or by downloading the source., (*3)
Via Composer:
EziteqAPI_PHP is available on the Packagist as the eziteq/eziteq-api_php package., (*4)
{
"require": {
"eziteq/eziteq-api_php": "{version}"
}
}
Via ZIP file:
Click here to download the source (.zip) which includes all dependencies., (*5)
Once you download the library, move the EziteqAPI_PHP folder to your project directory and then include the wrapper file:, (*6)
require '/path/to/EziteqAPI_PHP/EziteqAPI.php';
and you're good to go!, (*7)
Requirements
PHP 5.3.9 (or higher) is required. If you have access, PHP 5.4 (or higher) is highly recommended for its performance improvements., (*8)
Documentation
Contact Eziteq for a API access and documentation., (*9)
Example usage
<?php
use EziteqAPI_PHP\EziteqAPI;
// Make sure composer dependencies have been installed
require __DIR__ . '/vendor/autoload.php';
//Init and authenticate with Api key
$eziteq = EziteqAPI::init(array(
'apiKey' => 'a84fhgncmc432mgsa31' // Api key from Eziteq
));
//Init and authenticate with OAuth2
$eziteq = EziteqAPI::initOAuth2(array(
'clientId' => 14513528982,
'secret' => 'b3f89ee80ca90adf9fe75535c974a400',
'redirect_uri' => 'https://my.app/login'
));
if($eziteq->authenticate()) {
// Get subscriptions
$subscriptions = $eziteq->getSubscriptions();
// Get specific customer
$customer = $eziteq->getCustomer(array(
'customerId' => 5432
));
} else
throw new Exception($eziteq->getMessage(), $eziteq->getCode()));