MEP Expression Language
Built-in Variables Index
This is the full list of built-in variables.
Note that there are some variables that may be listed as decommissioned (noted beside the variable). You cannot use the decommissioned variable as a custom variable, as it may still return the value of the built-in variable.
The text from the most recent SMS message received in the session. This includes the keyword unless the service is set to strip the keyword from the message. This is set using the Remove keyword from message field in the Create Service and Update Service screens in the MEP UI.
Note that if the request period does not include a received SMS message, then the variable does not reference any value.
You can reference this variable in the Services tab only.
Type: string
Decommissioned.
This expression returns the delivery report state for an MT SMS. Delivery reports indicate whether a message was successfully delivered, failed, or was rejected. To provide more granularity for why a message was unsuccessful, there are multiple failure and rejected states. This enables you to create a service that can react based on why a message failed.
This expression must come after a Send SMS handler that is set to wait for delivery reports.
You can use this variable in the Services tab only.
Type: string
Reference the keyword sent by an end user to access a specific service. This function returns the keyword's description.
You can reference this variable in the Services tab only.
Type: string
Reference the keyword sent by an end user to access a specific service. This function returns the keyword identified in the message.
If you are using a regular expression capture group to find a keyword in the message, then you must select the Keyword field when you create the keyword, otherwise this variable will return a NULL value. See Using a Regular Expression to Capture a Keyword.
You can reference this variable in the Services tab only.
Type: string
Reference the keyword sent by an end user to access a specific service. This function returns the keyword identified in the message. This includes a percentage at the end of the keyword if the keyword matches "starts with", or a percentage sign at the start if the keyword matches "ends with".
You can reference this variable in the Services tab only.
Type: string
In a service, this identifies the routing code to which the SMS message was sent. As this variable will return a value only during a session’s first request, we recommend you use the variable:
session.initialKeyword.routingCode.name
You can reference this variable in the Services tab only.
Type: string, integer
The text, including the keyword, from the most recent SMS message received in the session.
Note that if the request period does not include a received SMS message, then the variable does not reference any value.
You can reference this variable in the Services tab only.
Type: string
The time and date that MEP received the most recent SMS message in the session, in the format yyyy-MM-dd hh:mm:ss. For this timestamp, the SMS Gateway uses the current time and date in London, United Kingdom (either GMT or BST, depending on the time of year).
Note that if the request period does not include a received SMS message, then the variable does not reference any value.
You can reference this variable in the Services tab only.
Type: string
Whether the most recent SMS message received in this session was a multipart message or not. This variable returns true if the SMS message is multipart.
You can reference this variable in the Services tab only.
Type: Boolean
References the details of multipart messages received by a service. This variable returns the time and date that the SMS Gateway received the specified message part of the most recent SMS message received in the session. The format is yyyy-MM-dd hh:mm:ss. For this timestamp, the SMS Gateway uses the current time and date in London, United Kingdom (either GMT or BST, depending on the time of year).
Note that if the most recent SMS received by the session is not a multipart message, then only the variable request.message.part[0].date will return a value.
You can reference this variable in the Services tab only.
Type: string
References the details of multipart messages received by a service. This variable returns the message text from the most recent SMS received by the session. The first part of a multipart message is accessed using the variable request.message.part[0].message, while the second part of a multipart SMS message is accessed using the variable request.message.part[1].message, etc.
Note that if the most recent SMS received by the session is not a multipart message, then only the variable request.message.part[0].message will return a value.
You can reference this variable in the Services tab only.
Type: string
References the details of multipart messages received by a service. This variable returns the SMS ID for the specified SMS message part of the most recent SMS message received by the session. This unique ID is generated by the OpenMarket SMS Gateway.
Note that if the most recent SMS received by the session is not a multipart message, then only the variable request.message.part[0].smsid will return a value.
You can reference this variable in the Services tab only.
Type: integer
The SMS ID for the most recent SMS message received in the session. This unique ID is generated by the OpenMarket SMS Gateway and is an integer.
Note that if the request period does not include a received SMS message, then the variable does not reference any value.
You can reference this variable in the Services tab only.
Type: integer
The text, not including the keyword, from the most recent SMS message received in the session.
Note that if the request period does not include a received SMS message, then the variable does not reference any value.
You can reference this variable in the Services tab only.
Type: string
Decommissioned.
For a UCS-2 encoded text message, this variable return a hexadecimal representation of the message. If the message is a standard GSM 03.38 message, the variable will not be populated.
You can reference this variable in the Services tab only.
Type: string
Whether the most recent SMS message sent in the session was a multipart message or not. This variable returns true if the SMS message is multipart.
You can reference this variable in the Services tab only.
Type: Boolean
This returns the SMS ID of the most recent MT message sent in a session. This variable enables you to specify specific parts of a multipart message.
Change the number in the brackets [] to reference the specific part. For example, the SMS ID for the first part of a multipart message is accessed using the variable:
request.mt.part[0].smsId
The SMS ID of the second part of a multipart message is accessed using the variable:
request.mt.part[1].smsId
Note that if the SMS sent by the session is not a multipart message, then only request.mt.part[0].message will return a value.
You can use this variable in the Services tab only.
Type: string
This returns the SMS ID of the most recent MT sent to an end user in a session.
If your message was a multipart message, then this variable returns the first part of the message.
You can use this variable in the Services tab only.
Type: string
This identifies the unique ID of the service processing the message.
You can reference this variable in the Services tab only.
Type: integer
This identifies the name of the service triggered by the message.
You can reference this variable in the Services tab only.
Type: string
The description of the subscription. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can reference this variable in the Services tab only.
Type: string
The unique alphanumeric ID of the subscription; for example, 0A45A7175F80C3F. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast. The ID is also visible in the subscription’s UI page in MEP.
You can reference this variable in the Services tab only.
Type: string
The name of the subscription. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can reference this variable in the Services tab only.
Type: string
The description of the collection that the subscription belongs to. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can reference this variable in the Services tab only.
Type: string
The unique alphanumeric ID of the collection that the subscription belongs to; for example, 75F80C390A45A71. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can also retrieve this value using the Subscriptions API.
You can reference this variable in the Services tab only.
Type: string
The name of the collection that the subscription belongs to. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can reference this variable in the Services tab only.
Type: string
An alphanumeric string that uniquely identifies the current request.
You can reference this variable in the Services tab only.
Type: string
This variable applies only to messaging in India. It identifies which telecoms circle (or "service area") the mobile number is a part of.
You must include the Network Lookup Handler in the service to use this variable, and the variable will need to come after the handler.
You can reference this variable in the Services tab only.
Type: string
Decommissioned.
Decommissioned.
Decommissioned.
The text from the first SMS message received in the session. This includes the keyword unless the service is set to ignore the keyword. This is set using the Ignore keyword when processing field in the Create Service and Update Service screens in the MEP UI.
You can reference this variable in the Services tab only.
Type: string
Decommissioned.
Reference the keyword sent by an end user to access a specific service. This function returns the keyword's description.
You can reference this variable in the Services tab only.
Type: string
Reference the keyword sent by an end user to access a specific service. This function returns the keyword identified in the message.
If you are using a regular expression capture group to find a keyword in the message, then you must select the Keyword field when you create the keyword, otherwise this variable will return a NULL value. See Using a Regular Expression to Capture a Keyword.
You can reference this variable in the Services tab only.
Type: string
Reference the keyword sent by an end user to access a specific service. This function returns the keyword identified in the message. This includes a percentage sign at the end of the keyword if the keyword matches "starts with", or a percentage at the start if the keyword matches "ends with".
You can reference this variable in the Services tab only.
Type: string
In a service, this identifies the routing code to which the SMS message was sent. A routing code can be one of: short code, virtual mobile number (long code), landline, toll-free or inject code.
You can reference this variable in the Services tab only.
Type: string, integer
The time and date that the SMS Gateway received the first message in the session, in the format yyyy-MM-dd hh:mm:ss. For this timestamp, the SMS Gateway uses the current time and date in London, United Kingdom (either GMT or BST, depending on the time of year).
You can reference this variable in the Services tab only.
Type: string
Whether the first SMS message received in this session was a multipart message or not. This variable returns true if the SMS message is multipart.
You can reference this variable in the Services tab only.
Type: Boolean
The text, including the keyword, from the first SMS message received in the session.
You can reference this variable in the Services tab only.
Type: string
References the details of multipart messages received by a service. This variable returns the time and date that the SMS Gateway received the specified message part of the first SMS message received in the session. The format is yyyy-MM-dd hh:mm:ss. For this timestamp, the SMS Gateway uses the current time and date in London, United Kingdom (either GMT or BST, depending on the time of year).
Note that if the first SMS received by the session is not a multipart message, then only the variable request.message.part[0].date will return a value.
You can reference this variable in the Services tab only.
Type: string
References the details of multipart messages received by a service. This variable returns the message text from the first SMS received by the session. The first part of a multipart message is accessed using the variable request.message.part[0].message, while the second part of a multipart SMS message is accessed using the variable request.message.part[1].message, etc.
Note that if the first SMS received by the session is not a multipart message, then only the variable request.message.part[0].message will return a value.
You can reference this variable in the Services tab only.
Type: string
References the details of multipart messages received by a service. This variable returns the SMS ID for the specified SMS message part of the first SMS message received by the session. This unique ID is generated by the OpenMarket SMS Gateway.
Note that if the first SMS received by the session is not a multipart message, then only the variable request.message.part[0].smsid will return a value.
You can reference this variable in the Services tab only.
Type: string
The SMS ID for the first SMS message received in the session. This unique ID is generated by the OpenMarket SMS Gateway and is an integer.
You can reference this variable in the Services tab only.
Type: integer
The text, not including the keyword, from the first SMS message received in the session.
You can reference this variable in the Services tab only.
Type: string
Decommissioned.
Decommissioned.
The description of the subscription. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can reference this variable in the Services tab only.
Type: string
The unique alphanumeric ID of the subscription; for example, 0A45A7175F80C3F. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast. The ID is also visible in the subscription’s UI page in MEP.
You can reference this variable in the Services tab only.
Type: string
The name of the subscription. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can reference this variable in the Services tab only.
Type: string
The description of the collection that the subscription belongs to. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can reference this variable in the Services tab only.
Type: string
The unique alphanumeric ID of the collection that the subscription belongs to; for example, 75F80C390A45A71. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can also retrieve this value using the Subscriptions API.
You can reference this variable in the Services tab only.
Type: string
The name of the collection that the subscription belongs to. This variable is available in a service after it is triggered by a subscription or subscription-related broadcast.
You can reference this variable in the Services tab only.
Type: string
An alphanumeric string that uniquely identifies the first request of the session. You can use this variable to easily reference a unique ID throughout a service.
You can reference this variable in the Services tab only.
Type: string
The description of the subscription. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can reference this variable in the Services tab only.
Type: string
The unique alphanumeric ID of the subscription; for example, 0A45A7175F80C3F. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service. The ID is also visible in the subscription’s UI page in MEP.
You can reference this variable in the Services tab only.
Type: string
The name of the subscription. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can reference this variable in the Services tab only.
Type: string
The description of the collection that the subscription belongs to. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can reference this variable in the Services tab only.
Type: string
The unique alphanumeric ID of the collection that the subscription belongs to; for example, 75F80C390A45A71. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can also retrieve this value using the Subscriptions API.
You can reference this variable in the Services tab only.
Type: string
The name of the collection that the subscription belongs to. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can reference this variable in the Services tab only.
Type: string
The description of the subscription. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can reference this variable in the Services tab only.
Type: string
The unique alphanumeric ID of the subscription; for example, 0A45A7175F80C3F. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service. The ID is also visible in the subscription’s UI page in MEP.
You can reference this variable in the Services tab only.
Type: string
The name of the subscription. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can reference this variable in the Services tab only.
Type: string
The description of the collection that the subscription belongs to. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can reference this variable in the Services tab only.
Type: string
The unique alphanumeric ID of the collection that the subscription belongs to; for example, 75F80C390A45A71. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can also retrieve this value using the Subscriptions API.
You can reference this variable in the Services tab only.
Type: string
The name of the collection that the subscription belongs to. This variable is available in a service when an end user has subscribed/unsubscribed to a subscription during the service.
You can reference this variable in the Services tab only.
Type: string
This variable is valid only when the service was triggered via unsubscribe notification routing. This type of routing is a separate configurable option found with your keyword routing.
This variable returns the date and time that MEP received the message. The format is yyyy-MM-dd hh:mm:ss.
You can reference this variable only in the Services tab.
Type: string
This variable is valid only when the service was triggered via unsubscribe notification routing. This type of routing is a separate configurable option found with your keyword routing.
This variable returns the short code that received the message.
You can reference this variable only in the Services tab.
Type: integer
This variable is valid only when the service was triggered via unsubscribe notification routing. This type of routing is a separate configurable option found with your keyword routing.
This variable identifies the source of the notification. This indicates the end user has unsubscribed via:
- STOP — the user has unsubscribed via an SMS STOP message
- UnknownSubscriber — after receiving a message from your service to the end user, the mobile operator has responded that the user is no longer available
- UNKNOWN — the message came from an alternative source
You can reference this variable only in the Services tab.
Type: string
Decommissioned.
The current date in London, United Kingdom, in the format yyyy-MM-dd. Depending on the time of year, this will be either GMT or BST.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
Creates a system-wide, alphanumeric unique ID.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs; however, it will always generate a new value. To reference the same value multiple times, you must create a custom variable to hold the value.
Type: string
The current date in the time zone set as your service’s local time, in the format yyyy-MM-dd. This time zone is set by OpenMarket when your services are first provisioned. It is not related to the location where you are currently accessing MEP, and so it may be set to a different time zone compared to the time zone of your current geographic location.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
The current date and time that is in the time zone you have set as your service's local date and time. This is in the format yyyy-MM-dd hh:mm:ss. This time zone is set by OpenMarket when your services are first provisioned. It is not related to the location where you are currently accessing MEP, and so it may be set to a different time zone compared to the time zone of your current geographic location.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
This expression starts a new line. This variable is useful in SMS, MMS and email message fields to format a line break, as some handsets and external platforms will not recognize a line break created using the Enter key (a carriage return).
You can also use this variable in an expression to add a new line in a single line text field, such as the Create/Update scope variable handler.
You can use this variable in the Services, Subscriptions and Broadcasts tabs of MEP.
Type: string
The current date and time in London, United Kingdom, in the format yyyy-MM-dd hh:mm:ss. Depending on the time of year, this will be either GMT or BST.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
The time and date that the end user’s details were first added to MEP, in the format yyyy-MM-dd. This timestamp uses the current time and date in London, United Kingdom (either GMT or BST, depending on the time of year). It is a global add date for that end user across all your services, rather than an add date for each service.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
A unique ID generated by MEP for the end user. This is a hexadecimal string; e.g. D649DC369FD68582.
This ID will be the same across all your subscriptions for the same end user.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
The end user's email address.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
The end user's phone number in international format. For example, 447700900760 (UK); 12515550123 (US); or 61491570110 (Australia). Note that this does not include a leading +.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
The end user’s mobile operator.
The value of this variable is "UNKNOWN" if the mobile operator is not known or if the end user's phone number is a landline.
You can reference this variable in the Services, Subscriptions and Broadcasts tabs.
Type: string
Decommissioned.
Decommissioned.