Skip to main content
The official PHP SDK for the Vobiz Voice API. Make calls, manage SIP trunks, handle CDR, record calls, configure phone numbers, and more - natively from your PHP application or framework. Source code: vobiz-ai/Vobiz-PHP-SDK

Installation

Install with Composer (once published to Packagist):
composer require vobiz/vobiz-php
Or build from source:
git clone https://github.com/vobiz-ai/Vobiz-PHP-SDK.git
cd Vobiz-PHP-SDK
composer install

Authentication

All API calls require your Auth ID and Auth Token, available in the Vobiz Console. The first argument (apiKey) maps to your Auth ID and is sent as the X-Auth-ID header; authToken is sent as X-Auth-Token.
<?php

require 'vendor/autoload.php';

use Vobiz\VobizClient;

$client = new VobizClient(
    apiKey: getenv('VOBIZ_AUTH_ID'),       // sent as X-Auth-ID
    authToken: getenv('VOBIZ_AUTH_TOKEN')  // sent as X-Auth-Token
);

Quick start

Make an outbound call:
<?php

require 'vendor/autoload.php';

use Vobiz\VobizClient;
use Vobiz\Calls\Requests\MakeCallRequest;

$authId = getenv('VOBIZ_AUTH_ID');
$client = new VobizClient(
    apiKey: $authId,
    authToken: getenv('VOBIZ_AUTH_TOKEN'),
);

$response = $client->calls->makeCall(
    $authId,                                 // your account Auth ID
    new MakeCallRequest([
        'from'         => '14155551234',     // Vobiz-enabled number or SIP URI
        'to'           => '+919876543210',   // destination in E.164 format
        'answerUrl'    => 'https://example.com/answer', // webhook returning VobizXML
        'answerMethod' => 'POST',
    ])
);

VobizXML

The SDK handles REST interactions only. When a call is answered, Vobiz fetches VobizXML from your answerUrl webhook to control the call:
<Response>
  <Speak voice="WOMAN" language="en-US">Thank you for calling.</Speak>
</Response>

Resources