Handling Incoming Messages

Plivo will forward incoming messages to the message_url configured for the application associated with the phone number on which the message was received.

Attributes

MessageUUID

This is the unique identifier for the message.

From

This is the source number of the incoming message. This will be the phone number from which the message originated.

To

This is the Plivo number on which the message was received.

Text

This is the content of the message. Note that Plivo automatically concatenates multi-part long messages before forwarding them to your message_url.

Type

This will always be set to sms.

Units

This is the number of parts in which the incoming message was received. This would > 1 for multi-part long messages.

TotalRate

This is the charge applicable per incoming SMS unit.

TotalAmount

Total charge for receiving the SMS (TotalRate * No. of Units)

MessageIntent

Set to optout if the incoming message matches with one of the standard Opt-Out keywords. Set to optin if the incoming message matches with one of the standard Opt-In keywords. Set to help if the incoming message matches with one of the standard Help keywords. Is left blank in all other cases.

Replying To An Incoming Message

It is possible to reply to an incoming message by returning a Plivo Message XML element in the response to the incoming request.

Make sure to set the response Content-Type to application/xml in this case.