CALLBACK (PUSH) - Receive Post Query Result
When you set up the callback URL, the result of each query is forwarded to the specified URL. The URL must be valid and return "200 OK" for every query to be valid. The inbox is sent as HTTPS POST JSON data.
PARAMETERS
Parameter | Type | Description |
---|---|---|
code | integer | The unique ID for the query |
servername | string | The server name identifier as specified when setting up the server |
refid | string | The custom reference id, if specified at the time of the query |
ussd | string | The query that was submitted |
reply | string | The reply sent by the network operator |
SAMPLE JSON DATA
{
"code":"2xxx",
"servername":"MTN Server",
"refid":"abcde01234",
"ussd":"*556#",
"reply":"Your balance is N28.08."
}
Sample Code to Accept Data
Sample PHP code to retrieve the inbox data
<?php
$data = json_decode(file_get_contents('php://input'), true);
$code = $data['code'];
$servername = $data['servername'];
$refid = $data['refid'];
$ussd = $data['ussd'];
$reply = $data['reply'];
//Do whatever you want to do with the data
?>