Skip to main content

Relay::Messaging::Message

An object representing an SMS or MMS message. It is the parameter of both on_incoming_message and on_message_state_change Consumer handlers.

Properties

PropertyTypeDescription
idStringThe unique identifier of the message.
contextStringThe context of the message.
fromStringThe phone number the message comes from.
toStringThe destination number of the message.
directionStringThe direction of the message: inbound or outbound.
stateStringThe current state of the message. See Message State Events for all the possible states.
bodyStringThe content of the message.
mediaArrayArray of URL media strings.
tagsArrayArray of strings with message tags.
segmentsNumericNumber of segments of the message.
reasonStringReason why the message was not sent.
Present only in case of failure.

Events

State Events

To track the state of a message.

StateDescription
queuedThe message has been queued in Relay.
initiatedRelay has initiated the process to send the message.
sentRelay has sent the message.
deliveredThe message has been successfully delivered. Due to the nature of SMS and MMS, receiving a delivered event is not guaranteed, even if the message is delivered successfully.
undeliveredThe message has not been delivered. Due to the nature of SMS and MMS, receiving a undelivered event is not guaranteed, even if the message fails to be delivered.
failedThe message delivery has failed.