1.
Method to realize
Application will send a HTTP GET request to the device, device will return HTTP 200 OK
response to the application.
2. Request describe
2.1 Request URL
http://host[:port]/goip_send_ussd.html
host: device IP address
port: web port,default is 80,(Optional)
2.2 URL
Parameter name Describe default Required
username Username No Yes
password Password NO Yes
port Which port to send ussd(begin with port 1) NO Yes
ussd Ussd command code NO Yes
timeout timeout(second) 120 No
retries Number of failed retries.
Note: the top-up service should set this
3 N
field to 0 and check if success by USSD
query.
3. Response describe:
Ussd HTTP response 200OK,and json data format return to the program.
3.1 Content-Type
Use json data corresponding Content-Type value application/json
3.2 Message body
Message body is Json data format, the property is as follow:
Property Describe Default Required
code Return code,0 means success NO Yes
reason Reason describe NO Yes
resp Ussd command response NO Yes
max-port Specify the max port NO Yes
port Means available port NO Yes
Notes: 1,3-6,8,10 means port 1,3,4,5,6,8,10 available。
3.3 Return code
Return code Describe
0 Success or OK
1 Username or password wrong
2 Port parameter wrong
3 No ussd parameter
4 Have incomplete USSD request
5 SIM not resisted
6 timeout
4. Example:
5. HTTP Link:
6. http://192.168.1.67/goip_send_ussd.html?username=root&password=root&port=5&ussd=1
23,Click this link,or via java program to send.
4.1 First example show how to send ussd
GET /goip_send_ussd.html?username=root&password=root&port=5&ussd=123 HTTP/ 1.1
Accept: */*
Accept-Language: zh-CN
User-Agent: Mozilla/4.0
Host: 192.168.1.67
Connection: Close
Response information as follow:
HTTP/1.1 200 OK
Server: Rapid Logic/1.1
Pragma: no-cache
Cache-Control: no-cache
Content-Type: application/json;charset=utf-8
Content-Length: 56
{code:0,reason:”OK”,resp:”your balance is 50.00$”}
4.2 Second example show how to get the available port
GET /goip_send_ussd.html?username=root&password=root HTTP/1.1
Accept: */*
Accept-Language: zh-CN
User-Agent: Mozilla/4.0
Host: 192.168.1.67
Connection: Close
Response information as follow:
HTTP/1.1 200 OK
Server: Rapid Logic/1.1
Pragma: no-cache
Cache-Control: no-cache
Content-Type: application/json;charset=utf-8
Content-Length: 56
{code:2,reason:”invalid param port”,max-port:16,port:”1,2,4-16”}
Notes: # will be ignore by the browser, it need to replace by %23