PHP code example of checkmango / php-sdk

1. Go to this page and download the library: Download checkmango/php-sdk 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/ */

    

checkmango / php-sdk example snippets


// Authentication
$client = new Checkmango\Client();
$client->authenticate('your_api_token');

// Example API Call
$experiment = $client->teams($teamId)->experiments()->show('EXPERIMENT_KEY');

$client->teams($teamId)->ingest()->store('EXPERIMENT_KEY', 'PARTICIPANT_KEY', 'VARIANT_KEY'); // Track impression
$client->teams($teamId)->ingest()->store('EXPERIMENT_KEY', 'PARTICIPANT_KEY', 'VARIANT_KEY', 'EVENT_KEY'); // Track conversion

$pager = new Checkmango\ResultPager($client);
$experiments = $pager->fetchAll($client->teams($teamId)->experiments(), 'all');
shell
composer