A simple wrapper around the SendPortal.IO Version 2 API.
You can install the package via composer:
composer require gaming-engine/sendportal-api-clientThis library is best used with a dependency injection library however, it is possible to instantiate is without the use of one.
You have access to several clients one for each type of endpoint that the API provides. The
The clients are as follows:
GamingEngine\SendPortalAPI\Clients\CampaignClientGamingEngine\SendPortalAPI\Clients\SubscriberClientGamingEngine\SendPortalAPI\Clients\SubscriberTagClientGamingEngine\SendPortalAPI\Clients\TagClientGamingEngine\SendPortalAPI\Clients\TagSubscriberClientGamingEngine\SendPortalAPI\Clients\TemplateClient
For more details about the request parameters for the API please refer to the documentation.
use GamingEngine\SendPortalAPI\Clients\ApiClient;
use GamingEngine\SendPortalAPI\Clients\CampaignClient;
use GamingEngine\SendPortalAPI\Http\GuzzleHttpClient;
use GamingEngine\SendPortalAPI\Models\Configuration;
use GuzzleHttp\Client;
require_once './vendor/autoload.php';
$apiClient = new ApiClient(
new Configuration('https://sendportal.domain.tld', 'bearer-token'),
new GuzzleHttpClient(
new Client()
)
);
$specific = new CampaignClient($apiClient);
var_dump($specific->retrieve());use GamingEngine\SendPortalAPI\Clients\ApiClient;
use GamingEngine\SendPortalAPI\Clients\CampaignClient;
use GamingEngine\SendPortalAPI\DataTransfer\CampaignDTO;
use GamingEngine\SendPortalAPI\Http\GuzzleHttpClient;
use GamingEngine\SendPortalAPI\Models\Configuration;
use GuzzleHttp\Client;
require_once './vendor/autoload.php';
$apiClient = new ApiClient(
new Configuration('https://sendportal.domain.tld', 'bearer-token'),
new GuzzleHttpClient(
new Client()
)
);
$specific = new CampaignClient($apiClient);
$dto = new CampaignDTO([
'name' => 'Hello',
// All fields
]);
// Provides the newly created campaign
var_dump($specific->create($dto));
// Provides the newly updated campaign
var_dump($specific->update(2, $dto));composer testPlease see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.