Skip to main content

Shortcode strings management

Shortcode string is a number, to which the USSD message can be sent (More on them in the next chapter: About shortcode strings). Shortcode string definition, on the other hand, is Stream App Editor's representation of the shortcode string. Such definition can consist of non-numeric parameters, which declare regular expressions. These regexen are then taken into account in the string resolving stage.

A list of shortcode string definitions is created by the Developer. When a user makes a USSD call, the shortcode string dialed by the user comes through the shortcode string resolving phase. In this phase the dialed shortcode string is being compared to the patterns of each shortcode string definitions created by the developer. If there is a match, then that starts a process linked to the matched shortcode string definition. Additionally, data extracted from the dialed shortcode string can be used as input for the executed USSD process.

In the string resolving phase, there's a possibility of multiple shortcode string definitions matching the dialed shortcode string. In such case, only the first definition from the list is chosen and the rest is omitted.

About shortcode strings

Every shortcode string consists of a shortcode and shortcode segments. It follows the same format: *shortcode*segment1*segment2*...#

Shortcode is a 3-digit number related to the services of an operator or a bank. Its registration is difficult and costly for an individual.

Shortcode segments are optional parts of shortcode strings, which can act as parameters or just static numbers.

Here's an Stream App Editor's example shortcode string for sending ₦100 to 1231231231: *425*0023*100*1231231231#. It consists of the following elements:

  • 425 is a shortcode, whose owner is QRIOS NETWORKS LIMITED.
  • 0023 is a segment which represents a developer's USSD application. As a consequence of that, 425*0023 can be thought of as developer's shortcode and 0023 as his/her subshortcode.
  • 100 is a first segment usable by the developer. In this case it represents transfer amount in ₦ currency.
  • 1231231231 is a second segment usable by the developer, which represents recipient's account number.

Shortcodes in Stream App Editor

Application short code is a string which is built with two parts, connected with *, eg. 425*023. First part (425) is registered Qrios API USSD short code. Second part (023) can be understood as sub short code which is correlated with the developer's USSD application registered on Qrios platform. That's why 425*023 can be thought of developer's shortcode. When a user dials eg. *425*023#, the request from network operator comes to Qrios platform and then it's dispatched to an application registered under 023.

Stream App Editor also has a Shortcode Definition Order Resolver, a testing tool which is used to check if a typed shortcode matches any shortcode definition from the list. It useful to check if the shortcode definition behaves as intended. The resolver tool presents the first matched shortcode string definition and highlights the rest, if there are mutliple matches.

Interface

SNNameFunction
1Header with actionsHouses button to execute actions
2Shortcodes listDisplays shortcode items
3Test tool buttonShows the shortcode strings test tool
4Create new buttonAllows to add a new, empty shortcode definition
5Save changes buttonAllows to save current changes

Shortcode definition order resolver

Here's a definition order resolver in action. It highlighted the matched shortcode string definition.

Notice, that the resolver shows a warning that there are other shortcode definitions, which also match a typed shortcode, but will not be executed. Such definitions are highlighted with a lighter color.