Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 773 Bytes

01.ivr.md

File metadata and controls

29 lines (23 loc) · 773 Bytes

IVR Broadcasts

Create a New IVR Broadcast

<?php
use CallFire\Api\Rest\Request;
use CallFire\Api\Rest\Response;
require 'vendor/autoload.php';

$dialplan = <<<DIALPLAN
<dialplan><play type="tts">Congratulations! You have successfully configured a CallFire I V R.</play></dialplan>
DIALPLAN;

$client = CallFire\Api\Client::Rest("<api-login>", "<api-password>", "Broadcast");

$request = new Request\CreateBroadcast;
$request->setName('My CallFire Broadcast');
$request->setType('IVR');
$request->setFrom('15551231234'); // A valid Caller ID number
$request->setDialplanXml($dialplan);

$response = $client->CreateBroadcast($request);
$result = $client::response($response);
if($result instanceof Response\ResourceReference) {
    // Success
}