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.

    Certain values provided in the list of attributes below will be posted to your callback based on the number type (long code, toll-free, or short code) and message type (SMS or MMS). We’ve updated the availability of these attributes under the name attribute.

    Note: LC — long code, TF — toll-free, SC — short code

    Attributes

    MessageUUIDSMS, MMSLC, TF, SC

    The unique identifier for the message.

    FromSMS, MMSLC, TF, SC

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

    ToSMS, MMSLC, TF, SC

    The Plivo number on which the message was received.

    TextSMSLC, TF, SC

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

    BodyMMSLC, TF

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

    TypeSMS, MMSLC, TF, SC

    Allowed values:  sms, mms
    Defaults to sms.

    UnitsSMS, MMSLC, TF, SC

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

    TotalRateSMS, MMSLC, TF, SC

    The charge applicable per incoming SMS unit.

    TotalAmountSMS, MMSLC, TF, SC

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

    MessageIntentSMSLC, TF

    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.

    PowerpackUUIDSMS, MMSLC, TF, SC

    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.

    MediaCountMMSLC, TF

    The number of media files attached with this MMS message.

    Media<count> ex: Media1, Media2 ...MMS LC, TF

    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.