MessageItem
A MessageItem object represents a message in the Reach platform.
Using the Reach Messaging API, it is possible to:
MessageItem Attributes
appletIdstring
The identifier of the applet sending or receiving the message.
apiVersionstring
The API version used to process the message.
bodystring
The message text.
deststring
The phone number in E.164 format that received the message.
srcstring
The phone number (in E.164 format), or the alphanumeric sender ID that initiated the message.
bulkIdstring
The bulk identifier allowing to group messages together and have corresponding statistics.
numSegmentsinteger
The number of segments associated to the message. A message body that is too large to be sent in a single SMS is segmented and charged as multiple messages. The segments are reassembled once received by the destination phone. A message can have a maximum of 10 segments. Refer to this section for more details.
numMediainteger
The number of media files included in the message.
pricenumber
The cost billed for the message, in the currency specified by
priceUnit
.priceUnitstring
The currency, in ISO 4127 format, in which price is measured. For example,
usd
,xaf
,eur
,cad
.messageIdstring
The identifier of the message.
statusstring
The status of the message. Can be:
sent
,scheduled
,failed
,delivered
,undelivered
,canceled
,accepted
,queued
,sending
,received
,receiving
. For more information, refer to the detailed description.messageTypestring
The type of the message. Can be:
inbound
for incoming messages,outbound
for messages initiated by the API.errorCodeinteger
The error code returned if the message status is
failed
orundelivered
. The errorMessage provides more information about the failure. The value isnull
if the message is successful.errorMessagestring
The error message returned if the message status is
failed
orundelivered
. The value isnull
if the message is successful.dateCreateddate-time
The date and time in UTC that the message was created.
dateSentdate-time
The date and time in UTC that the message was sent.
dateUpdateddate-time
The date and time in UTC that the message was last updated.
Number of message segments
The number of segments is an important property of SMS messages.
When sending an SMS, if the body of the SMS is more than 160 GSM-7 characters or 70 UCS-2 characters, then the SMS is segmented into multiple parts and each part is annotated in such a way to facilitate the reassembly of your SMS on the destination device.
Conversely, when receiving an SMS message, if it is made of multiple segments, the Reach Messaging API reassembles the different segments to form one sigle message.
You will be charged for each segment sent or received.
MessageItem status values
The status
attribute is meant to describe the stage at which a given messge is. The following table describes the different status values of an outbound
MessageItem object in the Reach platform.
Status value | Description |
---|---|
accepted | The reach platform has accepted your request for sending a message. |
scheduled | The message is scheduled to be sent later in the future. This is only observed when scheduling a message. |
queued | The message is queued and it will be sent out as soon as possible. |
sending | The Reach platform is currently sending the segments composing the message to the nearest network carrier. |
sent | The nearest network carrier has accepted the message. |
delivered | The Reach platform has received a confirmation of message delivery to the destination number. |
undelivered | The Reach platform has received a delivery receipt indicating that the message was not delivered. There are multiple causes behind this situation, including the network carrier's acceptable use and filtering policy or the availability of the destination device. |
failed | The message failed to send. There are multiple causes behind this situation, including queue overflows, or insufficient funds. You are not charged in this case. |
canceled | The message has been canceled. |
The following table describes the different status values of an inbound
MessageItem object in the Reach platform.
Status value | Description |
---|---|
receiving | The message was received by the Reach platform and is being processed. |
received | The message was received by the Reach platform and is the processing is over. |