Official PHP SDK for Pingram. Send notifications via Email, SMS, Push, In-App, and more from your PHP application.
- PHP 8.1+
- Composer
- guzzlehttp/guzzle (installed via Composer)
composer require pingram/phpOr add to your composer.json:
{
"require": {
"pingram/php": "^0.1"
}
}Then run composer install.
Use the Pingram\Client with your API key, then call send() or the namespaced APIs (getDomains(), getSender(), etc.).
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Pingram\Client;
use Pingram\Model\SenderPostBody;
$client = new Client('pingram_sk_...');
// Send a notification (delegates to the default/sender API)
$body = new SenderPostBody([
'notification_id' => 'your_notification_id',
'to' => ['id' => 'user_123'],
]);
$response = $client->send($body);
// Or use namespaced APIs: $client->getDomains(), $client->getSender(), etc.
// $senders = $client->getDomains()->domainsListDomains();You can override the base URL by passing a second argument: new Client('pingram_sk_...', 'https://api.example.com').
$client->send($body)– send a notification (high-level).$client->getDomains(),$client->getSender(),$client->getAccount(), etc. – low-level API objects. Each has methods matching the API (e.g.domainsListDomains,senderTestEmail).
For the full list of methods on each API, see the package's API_REFERENCE.md or the documentation.