CallFire Solutions

Query Texts

Follow

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

ParameterDemo ValueDescriptionData 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, FINISHED, DNC, DUP, INVALID, TIMEOUT] List[ActionState]
Result List of Results to query on[SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED] 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

Response Parameters

ParameterDescriptionData 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, FINISHED, DNC, DUP, INVALID, TIMEOUT] 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 [SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED] Result
Label    
Name   string
Message   string
TextRecord    
id   long
Result [SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, SD, POSTPONED] 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
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>

Have more questions? Submit a request

Comments