1. Go to this page and download the library: Download omnifox/sdk 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/ */
omnifox / sdk example snippets
Omnifox\OmnifoxClient;
$omnifox = new OmnifoxClient([
'apiKey' => getenv('OMNIFOX_API_KEY'),
'workspaceId' => 1, // optional, see "Workspaces"
// 'baseUrl' => 'https://app.omnifox.io/api/v1', // default
// 'timeout' => 30, // seconds
// 'maxRetries' => 3, // on 429 / 5xx / connection errors
]);
// Look a contact up by id, email, phone or external id.
$contact = $omnifox->contacts->get('email:[email protected]');
// Send a WhatsApp text.
$omnifox->messages->send([
'contact' => 'phone:+593987654321',
'channel_id' => 5,
'text' => 'Hello from the Omnifox PHP SDK',
]);
// Walk every open conversation; pages are fetched on demand.
foreach ($omnifox->conversations->list(['status' => 'open']) as $conversation) {
echo $conversation['id'], PHP_EOL;
}
foreach ($omnifox->contacts->list(['per_page' => 100]) as $contact) {
// every contact of the workspace
}
$first25 = $omnifox->contacts->list()->toArray(25);
$page = $omnifox->contacts->listPage(['page' => 2]);
$page->data; // list of rows
$page->hasMore; // bool
$page->page; // page mode: current page / lastPage / total
$page->nextCursor; // cursor mode
use Omnifox\Exception\ConflictException;
try {
$omnifox->appointments->book(['calendar_id' => 3, 'starts_at' => '2026-10-20T15:00:00Z']);
} catch (ConflictException $e) {
// the slot was taken in the meantime: offer another one
}
// Assignment is an assignee_type + assignee_id pair: user | team | ai_agent | none.
$omnifox->conversations->assign($id, ['assignee_type' => 'team', 'assignee_id' => 3, 'only_online' => true]);
$omnifox->conversations->assign($id, []); // unassign
// Closing reads `resolution` and `notes`.
$omnifox->conversations->close($id, ['resolution' => 'resolved', 'notes' => 'Refund sent']);
// WhatsApp / TikTok only allow free text for 24 h after the customer's last message.
if (!$omnifox->conversations->windowStatus($id)['open']) {
// send an approved template instead
}
bash
composer install
composer test # unit tests (no network)
OMNIFOX_TOKEN=... OMNIFOX_WORKSPACE_ID=1 \
OMNIFOX_E2E_WORKFLOW_ID=12 OMNIFOX_E2E_BROADCAST_ID=1 \
php tests/e2e/e2e.php --write # live run; deletes what it creates
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.