Send a message to a subscriber if that subscriber is subscribed to the channel. If the subscriber is not subscribed, status code 405 (Method Not Allowed) will be returned.
Response format | JSON |
---|---|
Requires authentication? | Yes |
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. |
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. |
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 |
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. |
shorten_urls optional | Optional boolean parameter have the system use the Chatitive URL shortener |
curl -X POST \
-u '[SID]:[TOKEN]' \
-H 'Content-Type: application/json' \
'https://api.essential.to/v2/account/channels/p03Gjl8Uzn0RkZSpHXHnrw/subscribers/p03Gjl8Uzn0RkZSpHXHnrw/messages' \
-d '{"body":"Hello subscriber."}'
# Sample response
{
"status": "queuing",
"body": "Hello subscriber.",
"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.