Response Data Definitions
Each endpoint returns a standardized set of data. Below are their definitions and usage.
Top-level Data
Key | Definition | Required |
---|---|---|
ussdMessage | A string that contains the display message that should be shown to the user. | Yes |
ussdOptions | An array of objects that contains the mapping of the options available to the user. | No |
ussdConfirm | An object that contains details to confirm a request when options are not available. | No |
Data payloads can either contain ussdOptions
and/or ussdConfirm
. At least
one of the objects will be returned with each response.
ussdOptions
A ussdOption
object gives you the details of the option order, the request url to confirm the option and the type of request to make.
Example payload:
Key | Definition |
---|---|
option | The order of the option chosen by the user |
requestUrl | The url endpoint to call to confirm the chosen option |
requestType | The request type to used to make the request |
uusdConfirm
The ussdConfirm
object is returned for the following reasons:
- There are no options available for the user interaction.
- The user has to manually input some value (ex: purchase/sell amount, searching stock symbol, etc…)
Example payload:
Key | Definition |
---|---|
requestUrl | The url endpoint to call to return the user to a specified view |
requestType | The request type used to make the request |