GET TEXT

This method gets a text message by its Id. It returns individual text message. See QueryTexts to return a list of text messages and determine individual textIds.

General usage is to start a text campaign using SendText, then to pass returned broadcastId to QueryTexts to determine textIds of text messages created. GetText can then be called with unique textId to determine info and state of text message.

Request Parameters

Parameter Data Type Demo Value Description
GetText object Text request by unique ID
Id long 135 Unique ID of resource

Response Parameters

Parameter Data Type Description
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 IVR stash value associated with 'varname'
Message string

[please explain what each of these mean and what should the developer do about them: [SENT, RECEIVED, DNT, TOOBIG, INTERNALERROR, CARRIERERROR, CARRIERTEMP_ERROR, SD, POSTPONED]]

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: GetText

using RestSharp;

namespace [your-namespace]
{
    public class [your-class]
    {
        public string GetText()
        {
            long textId = 1428507003; // Your Text Id here

            var client = new RestClient("https://www.callfire.com/api/1.1/rest/");
            client.Authenticator = new HttpBasicAuthenticator("YourLoginId", "password");

            var request = new RestRequest(string.Format("text/{0}", textId), Method.GET);

            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:Resource xmlns="http://api.callfire.com/data" xmlns:r="http://api.callfire.com/resource">

    <Text id="18">

       <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:ResourceReference>