Constants

AMCONFIG_AM_ONLY

AMCONFIG_AM_ONLY

AMCONFIG_AM_AND_LIVE

AMCONFIG_AM_AND_LIVE

AMCONFIG_LIVE_WITH_AMD

AMCONFIG_LIVE_WITH_AMD

AMCONFIG_LIVE_IMMEDIATE

AMCONFIG_LIVE_IMMEDIATE

BROADCAST_VOICE

BROADCAST_VOICE

BROADCAST_IVR

BROADCAST_IVR

BROADCAST_TEXT

BROADCAST_TEXT

COMMAND_START

COMMAND_START

COMMAND_STOP

COMMAND_STOP

COMMAND_ARCHIVE

COMMAND_ARCHIVE

EVENT_UNDEFINED_EVENT

EVENT_UNDEFINED_EVENT

EVENT_INBOUND_CALL_FINISHED

EVENT_INBOUND_CALL_FINISHED

EVENT_INBOUND_TEXT_FINISHED

EVENT_INBOUND_TEXT_FINISHED

EVENT_OUTBOUND_CALL_FINISHED

EVENT_OUTBOUND_CALL_FINISHED

EVENT_OUTBOUND_TEXT_FINISHED

EVENT_OUTBOUND_TEXT_FINISHED

EVENT_CAMPAIGN_STARTED

EVENT_CAMPAIGN_STARTED

EVENT_CAMPAIGN_STOPPED

EVENT_CAMPAIGN_STOPPED

EVENT_CAMPAIGN_FINISHED

EVENT_CAMPAIGN_FINISHED

FEATURE_UNSUPPORTED

FEATURE_UNSUPPORTED

FEATURE_PENDING

FEATURE_PENDING

FEATURE_DISABLED

FEATURE_DISABLED

FEATURE_ENABLED

FEATURE_ENABLED

FORMAT_XML

FORMAT_XML

FORMAT_JSON

FORMAT_JSON

FORMAT_SOAP

FORMAT_SOAP

FORMAT_EMAIL

FORMAT_EMAIL

INBOUND_TRACKING

INBOUND_TRACKING

INBOUND_IVR

INBOUND_IVR

RESULT_ANSWER_MACHINE

RESULT_ANSWER_MACHINE

RESULT_BUSY

RESULT_BUSY

RESULT_DO_NOT_CALL

RESULT_DO_NOT_CALL

RESULT_TRANSFER

RESULT_TRANSFER

RESULT_TRANSFER_LEG

RESULT_TRANSFER_LEG

RESULT_NO_ANSWER

RESULT_NO_ANSWER

RESULT_UNDIALED

RESULT_UNDIALED

RESULT_SENT

RESULT_SENT

RESULT_RECEIVED

RESULT_RECEIVED

RESULT_DID_NOT_TRY

RESULT_DID_NOT_TRY

RESULT_TOO_BIG

RESULT_TOO_BIG

RESULT_INTERNAL_ERROR

RESULT_INTERNAL_ERROR

RESULT_CARRIER_ERROR

RESULT_CARRIER_ERROR

RESULT_CARRIER_TEMP_ERROR

RESULT_CARRIER_TEMP_ERROR

STATE_READY

STATE_READY

STATE_SELECTED

STATE_SELECTED

STATE_FINISHED

STATE_FINISHED

STATE_DO_NOT_CALL

STATE_DO_NOT_CALL

STATE_DUPLICATE

STATE_DUPLICATE

STATE_INVALID

STATE_INVALID

STATE_TIMEOUT

STATE_TIMEOUT

STRATEGY_SEND_MULTIPLE

STRATEGY_SEND_MULTIPLE

STRATEGY_DO_NOT_SEND

STRATEGY_DO_NOT_SEND

STRATEGY_TRIM

STRATEGY_TRIM

Properties

$basePath

$basePath

$username

$username

$password

$password

$http

$http

Methods

SendCall()

SendCall(\CallFire\Api\Rest\Request\SendCall $SendCall)

Creates a call broadcast, adds numbers to it, and sends it immediately

Start sending calls using VoiceBroadcastConfig or by setting up an IVR using IvrBroadcastConfig. Sending a call requires at least a ToNumber and sound id or an IVR. The returned broadcastId can be passed to QueryCalls to get state of call actions in campaign and get list of individual callIds for use in GetCall request. The broadcastId can also be passed to GetBroadcastStats to get information about the call campaign, such as BilledAmount, Duration, State, etc...

Parameters

\CallFire\Api\Rest\Request\SendCall $SendCall

= null

QueryCalls()

QueryCalls(\CallFire\Api\Rest\Request\QueryCalls $QueryCalls)

Lists inbound and outbound calls

Query for calls using standard ActionQuery which filters on batchId, broadcastId, toNumber, etc... Returns a list of calls and all associated info. See GetCall to return just a single call action by id.

Parameters

\CallFire\Api\Rest\Request\QueryCalls $QueryCalls

= null

GetCall()

GetCall(int $Id)

Gets a call by ID

Return individual call action. See QueryCalls to return a list of call actions and determine individual callIds. General usage is to start a call campaign using SendCall, then to pass returned broadcastId to QueryCalls to determine callIds of call actions created. This GetCall can then be called with unique callId to determine info and state of call action.

Parameters

int $Id

Unique ID of resource

CreateSound()

CreateSound(\CallFire\Api\Rest\Request\CreateSound $CreateSound)

Creates a new CallFire-hosted sound for use in calls.

There are two ways to create a sound: (1) uploading a pre-recorded WAV or MP3, or (2) initiating a call to record a sound over the phone. Duplicate uploads are not allowed. If a duplicate sound data are provided, a new sound is not created. Instead, the ID of the previous sound is returned. Recording a sound over the phone works by first creating a sound asset using the RecordingCall option, then call the ToNumber to record live voice as sound. If sound is created using RecordingCall then need to wait for sound to be active by calling GetSoundMeta until Status = 'ACTIVE'. Use the returned soundId in a subsequent SendCall request.

Parameters

\CallFire\Api\Rest\Request\CreateSound $CreateSound

= null

QuerySoundMeta()

QuerySoundMeta(\CallFire\Api\Rest\Request\QuerySoundMeta $QuerySoundMeta)

Lists sounds available for use in calls.

Return list of sound meta info that includes id, status, name, length, etc... This operation only returns meta info, not the actual sound data. The raw binary sound data can be obtained from the GetSoundData.

Parameters

\CallFire\Api\Rest\Request\QuerySoundMeta $QuerySoundMeta

= null

GetSoundMeta()

GetSoundMeta(int $Id)

Gets metadata for a sound for use in calls

Return sound meta info for specified sound that includes id, status, name, length, etc... This operation only returns meta info, not the actual sound data. The raw binary sound data can be obtained from the GetSoundData.

Parameters

int $Id

Unique ID of resource

ns()

ns()

request()

request(string $type) : mixed

Instantiate a request object of the given type

Parameters

string $type

Request type

Returns

mixed —

Request object

response()

response(string $data, string $type) : mixed

Parse a response into a response type

Parameters

string $data

Response data to be parsed

string $type

= 'xml' Response format

Returns

mixed —

Response object

get()

get(string $uri, \CallFire\Api\Rest\Request $request) : string

Execute a GET request against an API endpoint, optionally with a given Request object as parameters

Parameters

string $uri

Endpoint URL

\CallFire\Api\Rest\Request $request

= null Request object for parameters

Returns

string —

Response data

post()

post(string $uri, \CallFire\Api\Rest\Request $request) : string

Execute a POST request against an API endpoint, optionally with a given Request object as parameters

Parameters

string $uri

Endpoint URL

\CallFire\Api\Rest\Request $request

= null Request object for parameters

Returns

string —

Response data

put()

put(string $uri, \CallFire\Api\Rest\Request $request) : string

Execute a PUT request against an API endpoint, optionally with a given Request object as parameters

Parameters

string $uri

Endpoint URL

\CallFire\Api\Rest\Request $request

= null Request object for parameters

Returns

string —

Response data

delete()

delete(string $uri, \CallFire\Api\Rest\Request $request) : string

Execute a DELETE request again an API endpoint, optionally with a given Request object as parameters

Parameters

string $uri

Endpoint URL

\CallFire\Api\Rest\Request $request

= null Request object for parameters

Returns

string —

Response data

buildQuery()

buildQuery(string $uri, array $parameters) : string

Build a request URI for a GET request

Parameters

string $uri

Endpoint URI

array $parameters

Key-value query parameters

Returns

string —

The resulting URL

buildPostData()

buildPostData(array $parameters) : string

Construct the POST fields data for a POST/PUT request, according to CallFire conventions

Reformats any array parameters to be a space-concatenated list of items. Any object parameters will be casted to a string, as possible.

Parameters

array $parameters

POST data

Returns

string —

Encoded POST data

getBasePath()

getBasePath()

setBasePath()

setBasePath( $basePath)

Parameters

$basePath

getUsername()

getUsername()

setUsername()

setUsername( $username)

Parameters

$username

getPassword()

getPassword()

setPassword()

setPassword( $password)

Parameters

$password

getHttpClone()

getHttpClone()

getHttp()

getHttp()

getUri()

getUri( $path,  $parameters)

Parameters

$path
$parameters

updateCredentials()

updateCredentials() : void

Rehashes the HTTP Basic Authentication on the HTTP client