HTTP API - Send USSD
POST https://gateway_ip/api/send_ussd
Request Parameters:
Parameter | Type | Description |
Required Parameter | ||
text | String | The content of SMS message to be sent; its length should not exceed 60 bytes.
When command is "send", text should not be empty; when command is "cancel", text can be empty. |
port | Array of Integers | Port(s) for sending USSD
Each port should be an integer ranging from 0 to 31 |
Optional Parameter | ||
command | String | It can be "send" or "cancel"; default value is "send" |
Response Parameters:
Parameter | Type | Description |
error_code | Integer | Codes that may be returned:
202: request has been accepted and processed. 400: it is an illegal request, for example, the command is “send” but text does not exist. 500: other errors |
result | Array | Results; each result include the following information:
Port: port for sending USSD Status: its value may be any of the following 200: USSD is sent successfully 486: the port is busy currently, for example, SMS is being sending through the port 503: the port is not registered currently |
Example of Sending USSD command:
Request:
curl -k --anyauth -u admin:admin -d '{"port":[1,2,3],"command":"send","text":"*125#"}' -H "Content-Type: application/json" https://gateway_ip/api/send_ussd
Response:
{"error_code":202,"sn":"xxxx-xxxx-xxxx-xxxx","result":[{"port":0, "status":503},{"port":1, "status":503},{"port":2, "status":200}]}