OpenVox SMS API Demo
OpenVox SMS API Demo
HTTP(s) to SMS:
Usage:
http://172.16.98.1:80/sendsms?username=xxx&password=xxx&phonenumber=xxx&message=xx
x&[port=xxx&][report=xxx&][timeout=xxx&][id=xxx]
1. Parameter Description
1.1 username
Description: The login username. Set in SMS settings page
Default Value: None
Necessity: Required
1.2 password
Description: The login password. Set in SMS settings page
Default Value: None
Necessity: Required
1.3 phonenumber
Description: Destination phonenumber to which the message is to be sent.
Default Value: None
Necessity: Required
Example: 10086,10087,10088
1.4 message
Description: Message to be sent.
Default Value: None
Necessity: Required
1.5 port
Description: Gsm port from which the message will be sent.
Default Value: By default, the message will be send from any ready gsm port of the gateway.
Necessity: Optional
Example: xxx-1, xxx-2, xxx-3 ...; eg: 1 or 2,3
xxx-1.1, ..., xxx-2.5, xxx-2.6,... ; eg: 1, 2, ..., 5, 6,....
1.6 report
Description: Result of sending. You can choose JSON or String or NO. It can be Set in SMS
settings page
Default Value: JSON
Necessity: Optional
1.7 timeout
Description: The report return timeout. Unit: second.
Default Value: 0
Necessity: Optional
1.8 id
Description: The uuid of SMS
Default Value: null
Necessity: Optional
2.1 JSON
{
"message":"xxx",
"report":[{
"0":[{
"port":"1",
"phonenumber":"10086",
"time":"2014-04-29 11:11:11",
"id":"1122",
"result":"sending"
}],
"1":[{
"port":"2",
"phonenumber":"10087",
"time":"2014-04-29 11:11:12",
"id":"1123",
"result":"fail"
}],
}]
}
2.2 STRING
message:xxx
--record 1 start--
port: 1
phonenumber: 10086
time: 2014-04-29 11:11:11
id: 1122
result: sending
--record 1 end--
--record 2 start--
port: 2
phonenumber: 10087
time: 2014-04-29 11:11:12
id: 1123
result: fail
--record 2 end—
SMS to HTTP(s)
Demo Code:
receivesms.php
<?php
$num = $_REQUEST['num'];
$port = $_REQUEST['port'];
$portname = $_REQUEST['portname'];
$time = $_REQUEST['time'];
$status = $_REQUEST['status'];
$type = $_REQUEST['type'];
$id = $_REQUEST['id'];
$imsi = $_REQUEST['imsi'];
$sms = $_REQUEST['message'];
$filedest = "/opt/sms/smsreport";
//if(!empty($type))
if(ture)
{
//fopen($filedest, "a+");
//echo "$content";
file_put_contents($filedest, $content.PHP_EOL, FILE_APPEND);
?>
Demo Usage:
http://172.16.6.165:80/sendsms?username=smsuser&password=smspwd&phonenumber=10086
&timeout=60&id=edeb7540&message=ye
-------------------------
You can get more details if you capture the http(s) requests and responses:
Send:
http://172.16.6.165:80/sendsms?username=smsuser&password=smspwd&phonenumber=10086
&timeout=60&id=39fd7439&message=ye
Received:
Captured: