Handling incoming SMS/MMS

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

    Attributes

    MessageUUID

    The unique identifier for the message.

    From

    The source number of the incoming message — the phone number from which the message originated.

    To

    The Plivo number on which the message was received.

    Text<SMS only>

    The content of the message. Note that Plivo automatically concatenates multipart long messages before forwarding them to your message_url.

    Body<MMS only>

    The text content (if any) in the multimedia message (MMS). Together, Body and Media should not exceed 5MB.

    Type

    Allowed values:  sms, mms
    Defaults to sms.

    Units

    The number of parts in which the incoming message was received. This is > 1 for multipart long messages.

    TotalRate

    The charge applicable per incoming SMS unit.

    TotalAmount

    Total charge for receiving the SMS (TotalRate * number 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. Left blank in all other cases.

    PowerpackUUID

    The UUID of the Powerpack associated with the To phone number. If the phone number does not belong to a Powerpack, this field is empty.

    MediaCount<MMS only>

    The number of media files attached with this MMS message.

    Media<count> ex: Media1, Media2 ...<MMS only>

    The URL to a specific media file associated with the MMS message. The integer suffixes range from 1 to the count of media files received.

    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.