1. Go to this page and download the library: Download selivery/enterprise-sdk-php 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/ */
selivery / enterprise-sdk-php example snippets
use Selivery\Enterprise\EnterpriseClient;
$client = new EnterpriseClient(getenv('SELIVERY_SECRET') ?: '');
/** @var Selivery\Enterprise\Models\SendResult $response */
$response = $client->send(
phone: '+12025550123',
idTemplate: 1,
// Vector is generated automatically and used for encryption and request body
secrets: [
['placeholder' => 'code', 'values' => '123456'],
]
);
use Selivery\Enterprise\EnterpriseClient;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;
$pool = new FilesystemAdapter(namespace: 'selivery', defaultLifetime: 0);
$psr16 = new Psr16Cache($pool);
// Options (optional):
// - base_url: override API base URL
// - timeout: request timeout in seconds
// - cache_key: override default key (default: selivery_enterprise_sdk_tokens:{sha1(baseUrl)})
// - token_safety_window: seconds before expiry to refresh (default: 60)
$client = new EnterpriseClient(
secret: getenv('SELIVERY_SECRET') ?: '',
cache: $psr16,
options: [
'token_safety_window' => 60,
// 'cache_key' => 'custom_key_per_env',
]
);
// The SDK generates tokens automatically on the first request,
// then reuses and refreshes them through the cache.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.