POST /api/v1/text_messages
Sends a message by submitting an outbound message request.

Examples

curl -H "Authorization: Basic BASE64_ENCODED_PUBLIC_KEY_AND_PRIVATE_KEY" -X POST "trackdrive.com/api/v1/text_messages?message=Thanks+for+your+inquiry&to=%2B16053334444"

Response Example

{
  "status": 200,
  "errors": {},
  "text_message": {
    "id": 812904581,
    "from": "+18554550000",
    "to": "+17190000000",
    "message": "Thanks for your submission! A representative call in 60 seconds.",
    "number_id": 147690000,
    "lead_id": 11000635,
    "provider_configuration_id": 12093,
    "message_uuid": "SM42efa83003ab41f9977ff292f48375cc",
    "ring_pool_id": null,
    "schedule_id": 192840,
    "status": "queued",
    "error_code": null,
    "created_at": "2019-08-29T15:58:21.850-04:00"
  },
  "checksum": "8e0fcaa8b1cc805d2323759e39a1a1ba",
  "metadata": {
    "root": "text_message"
  }
}

Params

Param name
Description
from
Optional Blank Value Allowed

Sending address (+E.164 formatted phone number.) Example: +18665550001

  • Must be a String

to
Optional Blank Value Allowed

Receiving address (+E.164 formatted phone number.) Example: +18665550001

  • Must be a String

lead_id
Optional Blank Value Allowed

Optional. Associate this text message with this lead. The lead's telephone number will be used as the Receiving address if “to” is not provided.

message
Required

Message body (i.e., content) as non-empty string. Example: Hello!

  • Must be a String

delivery_webhook_url
Optional Blank Value Allowed

Webhook to call when the message's status changes.

  • Must be a String

manual
Optional Blank Value Allowed

Pass true if this message is manually initiated by a human being in your application. When this is set to true Trackrive will skip checking if the “to” destination is on the DNC.

  • Must be a boolean value: 1, true, yes, on, 0, false, no, off

number_id
Optional Blank Value Allowed

Provide the sending address as an internal Trackdrive telephone number ID.

schedule_id
Optional Blank Value Allowed

Optional. If a lead exists on this schedule, this text message will be associated with it. If no lead currently exists, one will be created, and it will be added to this schedule.

offer_id
Optional Blank Value Allowed

Optional. Associate this text message with a matching lead on this offer. If no lead currently exists, one will be created on this offer.


GET /api/v1/text_messages
Retrieves details about text messages.

Response Example

{
  "status": 200,
  "errors": {},
  "text_message": {
    "id": 812904581,
    "from": "+18554550000",
    "to": "+17190000000",
    "message": "Thanks for your submission! A representative call in 60 seconds.",
    "number_id": 147690000,
    "lead_id": 11000635,
    "provider_configuration_id": 12093,
    "message_uuid": "SM42efa83003ab41f9977ff292f48375cc",
    "ring_pool_id": null,
    "schedule_id": 192840,
    "status": "queued",
    "error_code": null,
    "created_at": "2019-08-29T15:58:21.850-04:00"
  },
  "checksum": "8e0fcaa8b1cc805d2323759e39a1a1ba",
  "metadata": {
    "root": "text_message"
  }
}

Params

Param name
Description
ids
Optional

Return records matching these ids.

  • Must be an array of decimal values. EG: [0, 1, 2, 3]

page
Optional

Return the next page of results.

  • Must be a number.

per_page
Optional

How many results to return per page. The default is 25.

  • Must be a number.

created_at_to
Optional

Date formatted like 2016-01-01 12:25:15 -0500

  • Must be a String

created_at_from
Optional

Date formatted like 2016-01-01 12:25:15 -0500

  • Must be a String

fulltext
Optional

Search for any record that matches this text

  • Must be a String

time_zone
Optional

Date ranges will be parsed using this time zone.

columns
Optional
Specify the columns you would like returned by the API for a given resource. Limiting the columns can significantly increase API response time since only the requested data will be processed. columns=uuid,number,created_at

Must be any combination of:

  • id
  • legacy_id
  • type
  • uuid
  • created_at
  • updated_at
  • deleted_at
  • user_updated_at
  • routes_show_path
  • routes_edit_path
  • external_record_id
  • from
  • to
  • message
  • name
  • number_id
  • lead_id
  • provider_configuration_id
  • message_uuid
  • destination_caller_id
  • status
  • error_code
  • ring_pool_id
  • schedule_id
  • sent_at
  • manual
  • sms_blast_id
  • contact_id
  • delivery_webhook_url
  • text_message_flow_id
  • Must be a String

root
Optional

Pass root=false to return results without a root node and metadata.
For example:
GET /api/v1/calls?root=false will return [call1, call2, call3]
While:
GET /api/v1/calls will return {calls: [call1, call2, call3], metadata: {}}

  • Must be a boolean value: 1, true, yes, on, 0, false, no, off


GET /api/v1/text_messages/:id
Retrieves details about a specific text message request.

Response Example

{
  "status": 200,
  "errors": {},
  "text_message": {
    "id": 812904581,
    "from": "+18554550000",
    "to": "+17190000000",
    "message": "Thanks for your submission! A representative call in 60 seconds.",
    "number_id": 147690000,
    "lead_id": 11000635,
    "provider_configuration_id": 12093,
    "message_uuid": "SM42efa83003ab41f9977ff292f48375cc",
    "ring_pool_id": null,
    "schedule_id": 192840,
    "status": "queued",
    "error_code": null,
    "created_at": "2019-08-29T15:58:21.850-04:00"
  },
  "checksum": "8e0fcaa8b1cc805d2323759e39a1a1ba",
  "metadata": {
    "root": "text_message"
  }
}