PHP code example of eziteq / eziteq-api_php

1. Go to this page and download the library: Download eziteq/eziteq-api_php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

eziteq / eziteq-api_php example snippets




use EziteqAPI_PHP\EziteqAPI;

    // Make sure composer dependencies have been installed
    432mgsa31' // 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()));