Text

Texts endpoint

API path: https://www.callfire.com/api/1.1/rest/text

All api endpoints return response in XML format by default, to get response in JSON put .json at the end of API path.

Send a text

Sending a text message requires at least a toNumber and a message. SendText starts a text campaign and returns the broadcastId if campaign is successful started. This returned broadcastId can be passed to QueryTexts to get state of text messages in campaign and get list of individual textId for use in GetText calls.

Operation parameters

Example request

$ curl https://www.callfire.com/api/1.1/rest/text.json \
    -X POST \
    -u login:password \
    -d Type=TEXT \
    -d To=112132212384,14243876936 \
    -d BroadcastName=Send Api \
    -d From=67076 \
    -d Message=Hello Callfire

Example response

response code - 201 Created

{
    "ResourceReference": {
        "Id":609951003,
        "Location":"https://www.callfire.com/api/1.1/rest/broadcast/609951003"
    }
}

Query texts

Query for text messages and filter 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.

Operation parameters

Example request

$ curl https://www.callfire.com/api/1.1/rest/text.json \
    -u login:password \
    -X GET \
    -d MaxResults=2 \
    -d BroadcastId=6117655003 \
    -d Result=SENT \
    -d IntervalBegin=2016-02-01'T'23:00:00

Example response

response code - 200 OK

{
  "ResourceList": {
    "@totalResults": 2,
    "Text": [
      {
        "@id": 896807881003,
        "FromNumber": "67076",
        "ToNumber": {
          "value": "16505044730"
        },
        "State": "FINISHED",
        "BroadcastId": 6117655003,
        "ContactId": 685332955003,
        "Inbound": false,
        "Created": "2016-05-23T19:05:04Z",
        "Modified": "2016-05-23T19:05:03Z",
        "FinalResult": "SENT",
        "Message": "Api test message",
        "TextRecord": [
          {
            "@id": 494294178003,
            "Result": "SENT",
            "FinishTime": "2016-05-23T19:05:02Z",
            "BilledAmount": 1.0,
            "SwitchId": "watson-896807881003",
            "CallerName": "watson",
            "Message": "Api test message"
          }
        ]
      },
      {
        "@id": 896138978003,
        "FromNumber": "67076",
        "ToNumber": {
          "value": "16505339974"
        },
        "State": "FINISHED",
        "BroadcastId": 6117655003,
        "ContactId": 684986387003,
        "Inbound": false,
        "Created": "2016-05-23T16:26:38Z",
        "Modified": "2016-05-23T16:26:39Z",
        "FinalResult": "SENT",
        "Message": "Api test message",
        "TextRecord": [
          {
            "@id": 493815417003,
            "Result": "SENT",
            "FinishTime": "2016-05-23T16:26:37Z",
            "BilledAmount": 1.0,
            "SwitchId": "watson-896138978003",
            "CallerName": "watson",
            "Message": "Api test message"
          }
        ]
      }
    ]
  }
}

Get single text

Return individual text message. See QueryTexts to return a list of text messages and determine individual textIds.

Operation parameters

Example request

$ curl https://www.callfire.com/api/1.1/rest/text/6090706003.json \
    -u login:password

Example response

response code - 200 OK

{
  "Resource": {
    "Text": {
      "@id": 960348659003,
      "FromNumber": "16505044730",
      "ToNumber": {
        "value": "67076"
      },
      "State": "FINISHED",
      "ContactId": 732803714003,
      "Inbound": true,
      "Created": "2016-06-23T13:41:04Z",
      "Modified": "2016-06-23T13:41:03Z",
      "FinalResult": "RECEIVED",
      "Message": "KEYWORD hello Callfire!",
      "TextRecord": [
        {
          "@id": 533298364003,
          "Result": "RECEIVED",
          "FinishTime": "2016-06-23T13:41:04Z",
          "BilledAmount": 1.0,
          "SwitchId": "b682fcbe-60cd-43f5-966a-7dcbea177453",
          "Message": "KEYWORD hello Callfire!"
        }
      ]
    }
  }
}