Send a message

Send a message to a subscriber. In the near future we will support sending a message to channel.

Resource URL:

POST https://api.essential.to/v2/account/messages

Resource information:

Response formatJSON
Requires authentication?Yes

Parameters:

subscriber
required

The SID or phone number to which the message should be sent. Aliased as to.

body
required

The body of the message.

media_urls
optional

Collection of URLs pointing to media. These will be sent with an MMS. If providing media_urls, body may be omitted.

channel
required

The SID or name of a Channel on which this message should be sent.

transport
optional

The SID or endpoint representing the Transport via which this message should be sent. Aliased as from.

protocol
optional

Request the type of transport by which this message will be sent, without specifying one in particular. The requested protocol is not guaranteed.

Acceptable values are short and long.

priority
optional

We believe that encouraging conversations is a powerful application of the Essential platform. Inbound messages are given higher priority than outboud, and you might also want to have replies to delivery as quickly as possible. The priority optional parameter can be set to low if you want to allow other messages to be delivered first. This is encouraged when you are sending out "bulk" sends. Our Campaigns sends internally use the low priority mechanism.

onstatus_url
optional

Endpoint to which Essential will send callbacks when the message status changes.

is_template
optional

Whether or not the body should be evaluated as a Message Template. Default is false.

external_owner_id
optional

Optional parameter so you can track the source of the message.

Sample code:

curl -X POST \
  -u '[SID]:[TOKEN]' \
  -H 'Content-Type: application/json' \
  'https://api.essential.to/v2/account/messages' \
  -d '{"subscriber":"p03Gjl8Uzn0RkZSpHXHnrw","channel":"p03Gjl8Uzn0RkZSpHXHnrw","body":"Hello."}'

# Sample response
{
  "status": "queuing",
  "body": "Hello.",
  "media_urls": null,
  "notified_received_at": null,
  "notified_received_result": null,
  "onstatus_url": null,
  "notified_status_at": null,
  "notified_status_result": null,
  "status_updated_at": "2017-02-23T00:29:05.756Z",
  "created_at": "2017-02-23T00:29:05.760Z",
  "updated_at": "2017-02-23T00:29:05.760Z",
  "delivery_attempts": 0,
  "delivery_attempted_at": null,
  "msecs_in_flight": 0,
  "received_at": null,
  "dr_received_at": null,
  "sid": "ZYYYX5Z7EJQ8p08lNMSBnQ",
  "account_sid": "p03Gjl8Uzn0RkZSpHXHnrw",
  "channel_sid": "p03Gjl8Uzn0RkZSpHXHnrw",
  "transport_sid": "p03Gjl8Uzn0RkZSpHXHnrw",
  "subscriber_sid": "p03Gjl8Uzn0RkZSpHXHnrw",
  "to": "+12055551212",
  "from": "+12056666666"
}
Python coming soon.
Node coming soon.