Reference Multipart Messages

Multipart messages are divided into multiple SMS messages when sent by a device. Each part is received individually by the OpenMarket SMS Gateway, which then provides each part with a unique SMS ID and timestamp. MEP can receive a multipart message that is up to 255 parts from end user devices. However, MEP restricts outbound SMS messages to ten parts. Note, however, that we recommend sending multipart messages of up to four parts only, as many regions and mobile operators do not support greater than four-part SMS.

In most cases, EL treats a multipart message as if it is just one message. Note that:

  • Variables that refer to the body of the message — for example, request.defaultMessage — return the entire multipart message.
  • Variables that refer to an SMS ID — for example, request.message.smsId — return the SMS ID from the first part of the multipart message.
  • Variables that refer to the message date — for example, request.message.date) — return the date of the last part of the multipart message.

However, there are some variables that specifically treat each part of the message separately. These variables enable you to access details about the individual parts of a received multipart message as well as the text in each message part.

Finding out whether a message is multipart

If you need to find out if a message is multipart, you can use one of the following expressions which return either true or false:

${session.initialMessage.isMultipart}
${request.message.isMultipart}

If you need to know how many additional parts there are in a multipart message, you will need to do a null check. For example:

${not empty session.initialMessage.part[2].message}

This expression will return true if there is a third part to the multipart message, or false if no third part is found.