PHP code example of aftermarketpl / api

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

    

aftermarketpl / api example snippets


$client = new Aftermarketpl\Api\Client(array(
    "key" => "... your public key ...",
    "secret" => "... your secret key ...",
));

try {
    $result = $client->send("/domain/check", array(
        "names" => array("check-1.pl", "check-2.pl"),
    ));
    print_r($result);
}
catch(Aftermarketpl\Api\Exception\Exception $exception) {
    print_r($exception->getResponse());
}

$promise = $client->sendAsync("/domain/check", array(
    "names" => array("check-1.pl", "check-2.pl"),
));
$promise->then(
    function($result) {
        print_r($result);
    },
    function($exception) {
        print_r($exception->$getResponse();
    }
);
$promise->wait();



$client = new Aftermarketpl\Api\Client($options);

$result = $client->send($command, $parameters);

$promise = $client->sendAsync($command, $parameters);
$promise->then(function($response) { ... }, function($exception) { ... });
$response = $promise->wait();

$client->setAuth($key, $secret);`
$client->getAuthKey();
$client->getAuthSecret();
$client->setDebug($debug);
$client->getDebug();
$client->setUrl($url);
$client->getUrl();