POST request to your callback endpoint containing the complete input history for the current session. Your application processes the request and returns the next screen to display (CON) or ends the session (END).
The diagram below illustrates a typical USSD session from the initial dial through multiple menu selections until the session is completed.
Think of the integration as a loop:
- The subscriber dials
*123#. - Belio sends
inputs=[]to your callback URL. - Your application returns
CONwith the main menu. - The subscriber presses
1, then Belio sendsinputs=["1"]. - Your application returns
CONwith the next screen. - The subscriber presses
2, then Belio sendsinputs=["1", "2"]. - Your application returns either
CONto continue orENDto close the session.
POST request for every subscriber interaction and must respond with the next screen.
Action Meaning
Input Handling
Theinputs array contains the subscriber’s cumulative selections for the session, so every request carries the full path already taken:
- First dial ->
inputs: [] - After selecting
1->inputs: ["1"] - After then selecting
2->inputs: ["1", "2"] - After then selecting
3->inputs: ["1", "2", "3"]
- Re-process all inputs from scratch on each request, or use
sessionIdto load session state and determine which input is new.
Sample expected responses from your application
- Continue the session and show the next menu screen. This response tells Belio to keep the session open and show the subscriber the next menu screen.
- End the session and close the USSD dialog:
Callback Endpoint
Configure the callback URL on your USSD service channel in the Belio Cloud Portal. Belio sends aPOST request to your callback URL with the session state for the current hop.
Request Payload
Belio forwards aUssdForwardRequest payload.
Response Format
Return HTTP200 with a JSON body in the following shape:
Callback Requirements
Belio retries failed callbacks with exponential backoff, up to 5 attempts by default.
Malformed JSON responses are not retried.
Invalid Responses
If your callback returns a non-200 status, times out, or returns JSON that does not match the expected schema, Belio treats that hop as failed and shows an unavailable message to the subscriber.Next Step
UsesessionId as the key for any server-side session storage. Belio also records session hops internally for observability.