Skip to content

isabella232/testiat-api-client-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

testiat-api-client-php

This is the PHP API client for Testi@.

Installation

composer require bitexpert/testiat-api-client-php

Usage

emails.php

use \bitExpert\Testiat\Api;

require 'vendor/autoload.php';

$factory = new \Nyholm\Psr7\Factory\Psr17Factory();
$client = new \Buzz\Client\Curl($factory);

$api = new Api($psr7Client, $psr17Factory, 'someapikey');

You can also use vlucas/phpdotenv or symfony/dotenv.

Examples

$factory = new \Nyholm\Psr7\Factory\Psr17Factory();
$client = new \Buzz\Client\Curl($factory);

$api = new Api($client, $factory, 'someapikey');

$availableClients = $api->getAvailableClients();
$availableClients = $availableClients->getBody();
var_dump(json_decode($availableClients));

$projectStatus = $api->getProjectStatus('GlZfbnMcnRphPcRSyQwFVXbcn3');
$projectStatus = $projectStatus->getBody();
var_dump(json_decode($projectStatus));

$emailTest = $api->startEmailTest(
    'test123',
    '<p>Sample HTML code</p>',
    [1483107480, 1479404638]
);
$emailTest = $emailTest->getBody();
var_dump(json_decode($emailTest));

Available methods

All methods return a Promise and are either resolved to the API response or rejected with an Error object when one of the required arguments was not set or of the correct type.

getAvailableClients

List the email clients that you can use.

getProjectStatus($id)

Gets the status of the given project ID.

startEmailTest($subject, $html, $clients)

Starts a new email test using the given subject, html string and array of email client IDs.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%