Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 626 Bytes

03.text.md

File metadata and controls

25 lines (20 loc) · 626 Bytes

Text Broadcasts

Create a New Text Broadcast

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

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

$request = new Request\CreateBroadcast;
$request->setName('My CallFire Broadcast');
$request->setType('TEXT');
$request->setFrom('67076'); // CallFire shared short code
$request->setMessage('Hello World!');

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