QUERY TEXTS
Use the QueryTexts method to list text messages that have been sent and received.
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 | Data Type | Demo Value | Description |
---|---|---|---|
QueryTexts | object | Texts request by query | |
MaxResults | long | 1000 | Max number of results to return limited to 1000 (default: 1000) |
FirstResult | long | 0 | Start of next result set (default: 0) |
BroadcastId | long | 1 | BroadcastId to query on |
BatchId | long | 1 | BatchId to query on |
State | List[ActionState] | FINISHED TIMEOUT | List of Action States to query on [READY, SELECTED, CALLBACK, FINISHED, DNC, DUP, INVALID, TIMEOUT] |
Result | List[Result] | SENT RECEIVED | List of Results to query on [SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED] |
Inbound | boolean | true | Is call inbound |
IntervalBegin | dateTime | 2012-01-01T21:32:52Z | Beginning of DateTime interval to search on |
IntervalEnd | dateTime | 2013-10-26T05:36:10Z | End of DateTime interval to search on |
FromNumber | PhoneNumber | 13105551212 | E.164 11 digit number |
ToNumber | List[PhoneNumber] | 18185551212 | E.164 11 digit number |
LabelName | string | MyLabel | Label that result must have to be included |
Response Parameters
Parameter | Data Type | Description |
---|---|---|
TextQueryResult | List of Texts returned from query | |
TotalResults | long | Results count |
Text | ||
id | long | Unique ID of action |
FromNumber | PhoneNumber | E.164 11 digit number or short code |
ToNumber | List[PhoneNumber] | List of E.164 11 digit numbers space seperated |
State | ActionState | Current State of Action [READY, SELECTED, CALLBACK, FINISHED, DNC, DUP, INVALID, TIMEOUT] |
BatchId | long | Unique ID of Batch associated with Action |
BroadcastId | long | Unique ID of Broadcast associated with Action |
ContactId | long | Unique ID of Contact associated with Action |
Inbound | boolean | Is inbound Action |
Created | dateTime | DateTime Action was created 'CCYY-MM-DDThh:mm:ss[Z(+/-)hh:mm]' |
Modified | dateTime | DateTime Action was modified 'CCYY-MM-DDThh:mm:ss[Z(+/-)hh:mm]' |
FinalResult | Result | [SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED] |
Label | ||
Name | string | |
Message | string | |
TextRecord | ||
id | long | |
Result | Result | [SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED] |
FinishTime | dateTime | DateTime action finished in 'CCYY-MM-DDThh:mm:ss[Z(+/-)hh:mm]' format |
BilledAmount | float | Credits charged for call or text |
QuestionResponse | Question / Response pair defined in IVR campaign with [stash] (https://www.callfire.com/help/docs/callfire-xml/tags/stash). | |
Question | string | IVR stash 'varname' |
Response | string | IVR stash value associated with 'varname' |
Message | string |
State Options
READY:
The Call or Text is waiting to be executed.
SELECTED:
The Call or Text is currently being executed.
CALLBACK:
The Call will be retried probably because the number was busy.
FINISHED:
The Call or Text has been executed successfully.
DNC (call):
The Call or Text is to a number that is on a do-not-call list.
DUP:
The Call or Text is to a number which is already waiting to be executed.
INVALID:
The Call or Text is to a number which is in a bad format or otherwise incorrect.
TIMEOUT:
The Call or Text was attempted but the result has not been reported back.
Results for Calls
Live Answer:
The call was answered by a person.
Answering Machine:
The call was answered by an answering machine.
BUSY
The phone number was in a call already.
Do Not Call:
The Call was to a number that is on a do-not-call list.
Transfer:
The call was transferred.
No Answer:
No answer was obtained.
Transfer Leg:
The Call became part of a transfer.
Results for Texts
SENT:
The text message was sent successfully.
RECEIVED:
A reply to your text message was received.
Do Not Text:
The phone number is on a Do Not Text list.
Msg Too Big:
The text message was too long to be sent.
Results for both Call and Text
Internal Error:
The CallFire's service had an error. You should retry or call CallFire Support.
Carrier Error
The local telephone carrier is temporarily overloaded, or a high dialing speed to a certain location is causing the telecom provider to reject calls, or the phone number is disconnected.
Recoverable Carrier Error:
The local telephone carrier had a temporary error but the message will be retried by the Carrier.
Responses Status Codes
200, success
The request has been finished successfully.
400, bad request
This error code has a lot of possible causes, such as an account error or an incorrect parameter. First of all, check that all parameters have the correct data or data type. If the error persists, contact CallFire support.
401, not authorized
The username or password has some error. Perhaps the login has expired. Make sure that you valid account.
404, not found
The ID or Number that you are trying to edit or get was not found; you should check to see if it is correct.
500, internal error
This error is not caused by the user, but is CallFire's. Please contact support.
Example: QueryTexts
using RestSharp;
namespace [your-namespace]
{
public class [your-class]
{
public string QueryText()
{
var client = new RestClient("https://www.callfire.com/api/1.1/rest/");
client.Authenticator = new HttpBasicAuthenticator("YourLoginId", "password");
var request = new RestRequest("text", Method.GET);
request.AddParameter("MaxResults", "5");
request.AddParameter("BroadcastId", "1903340001");
request.AddParameter("IntervalBegin", "2015-01-01T21:32:52Z");
request.AddParameter("IntervalEnd", "2016-10-26T05:36:10Z");
var response = client.Execute(request);
string content = response.Content;
return content;
}
}
}
The XML returned is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<r:ResourceList xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource" totalResults="302">
<Text id="328">
<FromNumber>67076</FromNumber>
<ToNumber>14242709722</ToNumber>
<State>FINISHED</State>
<BroadcastId>1876425001</BroadcastId>
<ContactId>264793000003</ContactId>
<Inbound>false</Inbound>
<Created>2014-12-02T19:28:18Z</Created>
<Modified>2014-12-02T19:28:20Z</Modified>
<FinalResult>SENT</FinalResult>
<Message>Testing</Message>
<TextRecord id="214742362003">
<Result>SENT</Result>
<FinishTime>2014-12-02T19:28:18Z</FinishTime>
<BilledAmount>1.0</BilledAmount>
<Message>Testing</Message>
</TextRecord>
</Text>
</r:ResourceList>