CallFire has a new API!
We are proud to announce the launch of our API 2.0! Learn more about our streamlined, transactional and broadcast APIs. This version of the API documentation will remain available for reference only. There will be no new development, only bug fixes. We highly recommend upgrading to our newer and more sophisticated documentation.
Query for text messages using standard ActionQuery which filters on
batchId, broadcastId, toNumber, etc... Returns a list of text messages and
all associated info. See GetText
to return just a single text action by id.
Request Parameters
Parameter | Demo Value | Description | Data Type |
---|---|---|---|
QueryTexts | Texts request by query | object | |
MaxResults | Max number of results to return limited to 1000 (default: 1000) | long | |
FirstResult | Start of next result set (default: 0) | long | |
BroadcastId | BroadcastId to query on | long | |
BatchId | BatchId to query on | long | |
State | List of Action States to query on[READY, SELECTED, CALLBACK, DISABLED, SKIPPED, FINISHED, DNC, DUP, INVALID, TIMEOUT, PERIOD_LIMIT, RESTRICTED_NUMBER] | List[ActionState] | |
Result | List of Results to query on[LA, AM, BUSY, DNC, XFER, NO_ANS, XFER_LEG, SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, UNDIALED, SD, POSTPONED, ABANDONED, SKIPPED, INVALID_NUMBER] | List[Result] | |
Inbound | Is call inbound | boolean | |
IntervalBegin | Beginning of DateTime interval to search on | dateTime | |
IntervalEnd | End of DateTime interval to search on | dateTime | |
FromNumber | E.164 11 digit number | PhoneNumber | |
ToNumber | E.164 11 digit number | List[PhoneNumber] | |
LabelName | Label that result must have to be included | string |
* indicates choice value, bolded parameters are required
Response Parameters
Parameter | Description | Data Type |
---|---|---|
TextQueryResult | List of Texts returned from query | |
TotalResults | Results count | long |
Text | ||
id | Unique ID of action | long |
FromNumber | E.164 11 digit number or short code | PhoneNumber |
ToNumber | List of E.164 11 digit numbers space seperated | List[PhoneNumber] |
State | Current State of Action[READY, SELECTED, CALLBACK, DISABLED, SKIPPED, FINISHED, DNC, DUP, INVALID, TIMEOUT, PERIOD_LIMIT, RESTRICTED_NUMBER] | ActionState |
BatchId | Unique ID of Batch associated with Action | long |
BroadcastId | Unique ID of Broadcast associated with Action | long |
ContactId | Unique ID of Contact associated with Action | long |
Inbound | Is inbound Action | boolean |
Created | DateTime Action was created 'CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]' | dateTime |
Modified | DateTime Action was modified 'CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]' | dateTime |
FinalResult | [LA, AM, BUSY, DNC, XFER, NO_ANS, XFER_LEG, SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, UNDIALED, SD, POSTPONED, ABANDONED, SKIPPED, INVALID_NUMBER] | Result |
Label | ||
Name | string | |
Message | string | |
TextRecord | ||
id | long | |
Result | [LA, AM, BUSY, DNC, XFER, NO_ANS, XFER_LEG, SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, UNDIALED, SD, POSTPONED, ABANDONED, SKIPPED, INVALID_NUMBER] | Result |
FinishTime | DateTime action finished in 'CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]' format | dateTime |
BilledAmount | Credits charged for call or text | float |
QuestionResponse | Question / Response pair defined in IVR campaign with 'stash'. | |
Question | IVR stash 'varname' | string |
Response | IVR stash value associated with 'varname' | string |
SwitchId | string | |
CallerName | string | |
Message | string |
<?php
/**
* You'll need your login/password pair when you create the SOAP client.
* Don't use the fake login/password provided here; it's just for show and
* won't work.
*/
$wsdl = "http://callfire.com/api/1.1/wsdl/callfire-service-http-soap12.wsdl";
$client = new SoapClient($wsdl, array(
'soap_version' => SOAP_1_2,
'login' => 'YourLoginId',
'password' => 'YourPassword'));
/**
* QueryTexts. Search for Texts by 'BroadcastId', 'ToNumber', 'BatchId', etc.
*/
//
// Lets use $broadcastId returned from prevous call to #SendText that started a
// Text campaign. We can also limit the max number of records returned to 2.
//
$query = new stdclass();
$query->MaxResults = 2; // long
$query->BroadcastId = 328; // long
$response = $client->QueryTexts($query);
print_r($response);
//
// Filter search by State and Interval
//
$query = new stdclass();
$query->MaxResults = 2; // long
$query->BroadcastId = 328; // long
$query->State = array('FINISHED', 'TIMEOUT', 'INVALID'); // List[ActionState]
$query->IntervalBegin = '2012-01-01T21:32:52Z'; // dateTime
$query->IntervalEnd = '2013-10-26T05:36:10Z'; // dateTime
$response = $client->QueryTexts($query);
print_r($response);
// Sample output:
// stdClass Object
// (
// [TotalResults] => 2
// [Text] => Array
// (
// [0] => stdClass Object
// (
// [FromNumber] => 67076
// [ToNumber] => stdClass Object
// (
// [_] => 18185551212
// )
// [State] => INVALID
// [BatchId] => 330
// [BroadcastId] => 328
// [ContactId] => 4422
// [Inbound] =>
// [Created] => 2013-03-06T11:40:32-08:00
// [Modified] => 2013-03-06T11:40:32-08:00
// [id] => 9649
// )
//
// [1] => stdClass Object
// (
// [FromNumber] => 67076
// [ToNumber] => stdClass Object
// (
// [_] => 13105551212
// )
// [State] => INVALID
// [BatchId] => 330
// [BroadcastId] => 328
// [ContactId] => 4421
// [Inbound] =>
// [Created] => 2013-03-06T11:40:32-08:00
// [Modified] => 2013-03-06T11:40:32-08:00
// [id] => 9648
// )
// )
// )
?>