This is the official ClickSend SDK. Documentation can be found here.
- Sign Up for a free ClickSend account.
- Copy your API key from the API Credentials area.
- PHP 5.5 and later
To install the bindings via Composer, run the following command in terminal, inside your project directory:
composer require clicksend/clicksend-php
Download the files and include autoload.php
:
require_once('/path/to/clicksend-php/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new ClickSend\Api\AccountApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->accountGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->accountGet: ', $e->getMessage(), PHP_EOL;
}
?>
Documentation for our SDK and REST API can be found here.
- Type: HTTP basic authentication