Message Resource
A Message resource represents an inbound or outbound message. Whoosh creates a Message when any of the following occur:
With the Message resource, you can:
If you're using Messaging Services , you can also use the Message resource to:
A Message resource can also have a Media sub-resource and/or a MessageFeedback sub-resource.
For step-by-step instructions for sending your first SMS with Whoosh, check out one of the Twilio SMS quickstarts. If you're looking for how to respond to incoming messages, check out the Twilio's How to Receive and Reply to SMS Messages tutorial. We are 100% Twilio compatible.
Message properties
num_segments
string
Not PII The number of segments that make up the complete message. SMS message bodies that exceed the character limit are segmented and charged as multiple messages. Note: For messages sent via a Messaging Service,
num_segments
is initially 0
, since a sender hasn't yet been assigned.direction
enum:direction
Not PIIThe direction of the message. Can be:
inbound
for incoming messages, outbound-api
for messages created by the REST API, outbound-call
for messages created during a call, or outbound-reply
for messages created in response to an incoming message.from
phone_number
PII MTL: 120 DAYSThe sender's phone number (in E.164 format), alphanumeric sender ID, Wireless SIM , short code, or channel address (e.g.,
whatsapp:+15554449999
). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Whoosh phone number, alphanumeric sender ID, short code, or channel address from which the message is sent.to
string
PII MTL: 120 DAYSThe recipient's phone number (in E.164 format) or channel address. (e.g.
whatsapp:+15552229999
)date_updated
date_time<rfc2822>
Not PII The RFC 2822 timestamp (in GMT) of when the Message resource was last updated
price
string
Not PIIThe amount billed for the message in the currency specified by
price_unit
. The price
is populated after the message has been sent/received, and may not be immediately available. Contact us for details on pricing.error_message
string
Not PIIThe description of the
error_code
if the Message status
is failed
or undelivered
. If no error was encountered, the value is null
.uri
string
Not PIIThe URI of the Message resource, relative to
https://api.whoosh.totogi.solutions
.status
enum:status
Not PIIThe status of the Message. Possible values:
accepted
, scheduled
, canceled
, queued
, sending
, sent
, failed
, delivered
, undelivered
, receiving
, received
, or read
(WhatsApp only). For more information, See detailed descriptions.messaging_service_sid
sid<MG>
Not PIIThe SID of the Messaging Service sub-resource associated with the Message resource. The value is
null
if a Messaging Service was not used.date_time<rfc2822>
Not PIIThe RFC 2822 timestamp (in GMT) of when the Message was sent. For an outgoing message, this is when Whoosh sent the message. For an incoming message, this is when Whoosh sent the HTTP request to your incoming message webhook URL.
date_created
date_time<rfc2822>
Not PIIThe RFC 2822 timestamp (in GMT) of when the Message resource was created
error_code
integer?
Not PIIThe error code returned if the Message
status
is failed
or undelivered
. If no error was encountered, the value is null
. We are 100% Twilio compatible, check out Twilio error codes for more information.price_unit
currency
Not PIIThe currency in which
price
is measured, in ISO 4127 format (e.g. usd
, eur
, jpy
).subresource_uris
uri_map
Not PIIA list of related resources identified by their URIs relative to
https://api.whoosh.totogi.solutions
Message Status values
The table below lists possible values of an outbound Message resource'sStatus
property.Values with an asterisk * are only for messages sent with Messaging Services.
Value | Description |
---|---|
queued | The API request to send a message was successful and the message is queued to be sent out. This is the initial Status for outgoing messages that don't use Messaging Services. |
accepted * | Whoosh has received your API request to send a message with a Messaging Service and a From number is being dynamically selected. If you provide a MessagingServiceSid and a From value when creating a new Message resource, the initial status is queued . |
scheduled * | The Message resource is scheduled to be sent. This is the initial Status for scheduled messages. |
canceled * | The message has been canceled. |
sending | Whoosh is in the process of dispatching your message to the nearest upstream carrier in the network. |
sent | The nearest upstream carrier accepted the message. |
delivered | Whoosh has received confirmation of message delivery from the upstream carrier, and, where available, the destination handset. |
read | WhatsApp only: The recipient opened the message. Recipient must have read receipts enabled. |
undelivered | Whoosh received a delivery receipt indicating that the message was not delivered. This can happen for many reasons including carrier content filtering and the availability of the destination handset. We are 100% Twilio compliant, checkout Twilio error codes for more information. |
failed | The message failed to send. This can happen for various reasons including queue overflows, Account suspensions and media errors. Whoosh does not charge you for failed messages. We are 100% Twilio compliant, checkout Twilio error codes for more information. |
Status
property.Value | Description |
---|---|
receiving | The inbound message was received by Whoosh and is currently being processed. |
received | The inbound message was received and processing is complete. |
NumSegments property
TheNumSegments
property is relevant for SMS messages only.For outbound SMS messages, this property indicates the number of SMS messages it took to deliver the body of the message.
If the body of a message is more than 160 GSM-7 characters (or 70 UCS-2 characters), Whoosh segments and annotates your messages to attempt proper reassembly on the recipient's handset (not supported by all carriers and handsets). This ensures your body text transmits with the highest fidelity.
On inbound SMS messages, this property indicates the number of SMS messages that make up the message received.
If the body of a message is more than 160 GSM-7 characters (or 70 UCS-2 characters), Whoosh attempts to reassemble the message received by your Whoosh phone number. All carriers and handsets do not necessarily support this.
Your account is charged for each segment sent or received.