CallFire Solutions

Get Text

Follow

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

ParameterDemo ValueDescriptionData Type
GetText   Text request by unique ID object
Id Unique ID of resource long

Response Parameters

ParameterDescriptionData Type
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

[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>

 

Have more questions? Submit a request

Comments