Skylline Gateway HTTP API (V2.0.011) en
Skylline Gateway HTTP API (V2.0.011) en
Skylline Gateway HTTP API (V2.0.011) en
Version: 2.0.011
Related Document
Doc No. Description
Distribution
1
2
Amendment History
Table of Content
1 OVERVIEW............................................................................................................................................1
2 COPYRIGHT NOTICE.........................................................................................................................1
3 STATUS NOTIFICATION....................................................................................................................1
3.1.1 URL.............................................................................................................................................. 1
3.1.2 Parameter....................................................................................................................................1
3.1.3 Dev-status message..................................................................................................................2
3.1.4 Port -status message.................................................................................................................3
4 OPERATE COMMAND SENDING.....................................................................................................4
4.1.1 Command sending URL............................................................................................................4
4.1.2 Parameter....................................................................................................................................4
4.1.3 Data..............................................................................................................................................5
5 SMS SENDING.......................................................................................................................................6
5.1 TOPOLOGY................................................................................................................................................................................ 6
5.2 SMS SENDING FLOW CHART............................................................................................................................................... 7
5.2.1 SMS sending...............................................................................................................................7
5.2.2 Sending status report................................................................................................................ 7
5.2.3 Sending status query.................................................................................................................7
5.2.4 Status query................................................................................................................................8
5.2.5 Pause the SMS task.................................................................................................................. 8
5.2.6 Resume the paused SMS task................................................................................................ 8
5.2.7 Delete the SMS task..................................................................................................................8
5.2.8 Query the SMS task...................................................................................................................8
5.3 MESSAGE DESCRIPTION....................................................................................................................................................... 8
5.3.1 SMS Sending..............................................................................................................................8
5.3.2 Task send report...................................................................................................................... 11
5.3.3 Task send status query........................................................................................................... 13
5.3.4 Pause the SMS task................................................................................................................ 14
5.3.6 Delete the SMS task.................................................................................................................17
5.3.7 Query the SMS task................................................................................................................. 18
5.4 EXAMPLE................................................................................................................................................................................ 20
6 SMS FORWARDING.......................................................................................................................... 20
6.1 TOPOLOGY............................................................................................................................................................................. 20
6.2 SMS FORWARDING.............................................................................................................................................................. 20
6.2.1 SMS Forward URL.................................................................................................................. 20
6.2.2 Parameter................................................................................................................................. 21
6.2.3 Data............................................................................................................................................21
7 QUERY SMS.........................................................................................................................................21
7.1 QUERY PROCESS................................................................................................................................................................... 22
7.2 MESSAGE DESCRIPTION..................................................................................................................................................... 22
7.2.1 URL............................................................................................................................................ 22
7.2.2 Parameter..................................................................................................................................22
7.2.3 Data............................................................................................................................................22
8 QUERY SMS STATISTICS................................................................................................................ 24
8.1 MESSAGE DESCRIPTION..................................................................................................................................................... 24
8.1.1 URL............................................................................................................................................ 24
8.1.2 Parameter..................................................................................................................................24
8.1.3 Response.................................................................................................................................. 25
...........................................................................
1 Overview
This document specifies HTTP SMS API of device, include SMS receiving, single sending,
group-sending and status of Sending task querying.
Based on SMS sending API’, this document extra support Group-Sending
and multi task and status report support in one message.
This SMS API is still base on HTTP, and add POST request support, it provide multitask and
status report by JSON array. About JSON array format, please refer its standardization state.
2 Copyright Notice
This document is just for R&D team reference. If in need, it can be offered to a
cooperation project developer.
3 Status Notification
This device will send a HTTP POST request which include the device running status information
to the SMS server when it reaches either of below conditions.
1. One of device port status changed.
2. Community period expired.
3.1.1 URL
Server can send a GET request to get the status on device by below URL:
http://host:port/goip_get_status.html?url=xxx&period=0
3.1.2 Parameter
For the description of the port status, see 3.1.4 [Port Status]
“100.00”,
“opr”:
“46000 China Mobile”,“sn”:“139xxxxxxxxx”, “imei”:“86xxxxxxxxxxxxx”,
“imsi”:“xxx”,“iccid”:“xxx”}
Components state:
Parameter Data Description
Default Required
type
Device will send message to the server by port status notification when lock port or change
SIM card.
4.1.1 URL
http://host:port/goip_send_cmd.html
host: Device IP address
port: Device webpage management port, default value is 80.
4.1.2 Parameter
4.1.3 Data
type
op string Operation type
lock: lock port
unlock:unlock port None Y
switch:switch SIM card
reset: reboot module
5 SMS Sending
Server send SMS sending request to device by Ethernet, and it keep sending task in a JSON
array.
5.1 Topology
While device and server not in a same LAN, device HTTP port should been Nat
mapping out on boundary router, so server can send message to device actively.
5.3.1.2 Parameter
Note: All URL parameters only appear in the GET request. For POST, it will appear in
the JSON attribute of the body segment. The following will not be explained.
5.3.1.3 Data
The task data (the body segment of the HTTP message) is a JSON format string
consisting of one or more tasks, and the value of the HTTP header parameter
"Content-Type" is “application/json;charset=utf-8”。
{“type”:“send-sms”,“task_num”:n,“tasks”:[{“tid”:tid_1, …},…,{“tid”:tid_n, …}]}
Components state:
Parameter Data Description Remark
Default Required
type
sms_cnt Int Max num of SMS can 1. When the buffer number
1 N reaches this value, the
keep in cache
buffered SMS is sent
immediately and the timer is
reset.
2. In order to be
compatible with old
customers, this parameter
must be set to a value
greater than 1, in order to
buffer the received SMS and
use the new sending
mechanism.
sms_prd Int Max time SMS can 1. The time expired, even
if not enough SMS is
keep in cache 30 N received, it is sent
immediately, then the timer
is reset.
task_num string Total task 1 Y
tasks Array Specific SMS send task None Y
3、Remarks:
a. There can be a most of 5 attachment,all
attachment total length cannot exceed 100K,at
4、example:
“txt|zsSxvg==;jpg|4AAQSkZJRgABAgAAZABk”
smsc string Store the SMSC number. “” N
intvl string Interval of 2 SMS while device sending them(ms) “0” N
tmo Int Max time while waiting sending result(second). 30 N
Tips:
1. While not choose a port, device will pick up a random port to send SMS to every
recipient.
2. While chose more than one ports, and just one SMS recipient , then device will use
all chose port to send SMS to this recipient.
3. If more ports, and more recipient designed, then every port will send SMS to every
recipient separately.
5.3.1.4 Response
Task sending is a JSON array composed by one or more task send status,
Parameter “Content-Type” in HTTP head should set to
“application/json;charset=utf- 8”.
{ “code”:200, “reason”:“OK”,“type”:“task-status”, “status”:[{“tid”:tid_1,
“status”:“0 OK”},…,{“tid”:tid_n, “status”:“2 Invalid Port”}]}
5.3.2.1 URL
Server or device configuration decision.
5.3.2.2 Parameter
5.3.2.3 Data
Components state:
Parameter Data Description
Default Required
type
type string Message type None Y(status-report)
rpt_num string Report num 1 Y
rpts Array Detail status report None Y
Tips:
1. tid related to the task ID in the send-sms message.
2. sending, sent, failed are accumulated num in one task.
3. Sdr(successfully send record) list records between 2 status-report, server should
keep before details.
Document No : xxxxxxx 5/16/2020 Page 16
Version: 2.0
HTTP SMS Development Spec.
4. fdr(failed detail record) list records between 2 status-report, server should keep
before details.
5.3.3.2 Parameter
5.3.3.3 Data
The data (the body segment of the HTTP message) is a JSON format string
consisting of one or more tasks, and the value of the HTTP header parameter
"Content-Type" is “application/json;charset=utf-8”.
{“tids”:[tid1,tid2,…,tidn]}
Components state:
Parameter Data Description
Default Required
type
tids String Restore one or more tasks ID No. When there
None is no field, all
that are sent.
send tasks are
suspended.
The body of the query response is a JSON format string consisting of one or
more tasks. The value of the HTTP header parameter "Content-Type" is
"application/json; charset=utf-8".
{“code”:200,“reason”:“OK”, “results”:[{“tid”:tid_1, “status”:
“0 OK”},…,{“tid”:tid_n, “status”:“2 Invalid Port”}]}
Components state:
Parameter Data type Description Default Requ
http://host:port/goip_resume_sms.html
host: device IP address
port: device web port,the default is 80,optional.
5.3.4.2 Parameter
5.3.4.3 Data
Data(The body segment of the HTTP message)is a JSON array composed by one
or more task. Parameter Content-Type in HTTP head should set to
“application/json;charset=utf-8”.
{“tids”:[tid1,tid2,…,tidn]}
Attributes instructions:
Parameter Data Description
Default Required
type
The body of response is a JSON array composed by one or more task ID.
Parameter “Content-Type” in HTTP head should set to“application/json;charset=utf-8”.
{“code”:200,“reason”:“OK”, “results”:[{“tid”:tid_1, “status”:
“0 OK”},…,{“tid”:tid_n, “status”:“2 Invalid Port”}]}
Attributes instructions:
http://host:port/goip_remove_sms.html
host: device IP address.
Document No : xxxxxxx 5/16/2020 Page 19
Version: 2.0
HTTP SMS Development Spec.
5.3.5.2 Parameter
5.3.5.3 Data
Data(The body segment of the HTTP message)is a JSON array composed by one
or more task. Parameter Content-Type in HTTP head should set to
“application/json;charset=utf-8”.
{“tids”:[tid1,tid2,…,tidn]}
Attributes instructions:
Parameter Data Description
Default Required
type
tids String The task ID to be restored. NO. Restore all
sending
None tasks when
there is no
field.
The body of response is a JSON array composed by one or more task ID. Parameter “Content-Type”
in HTTP head should set to “application/json;charset=utf- 8”.
{“code”:200,“reason”:“OK”, “results”:[{“tid”:tid_1, “status”:
“0 OK”},…,{“tid”:tid_n, “status”:“2 Invalid Port”}]}
Attributes instructions:
Parameter Data type Description Default Required
0:OK
1:Invalid User
2:Invalid Port
3:USSD Expected
4:Pending USSD
5:SIM Unregistered
6:Timeout
7:Server Error
8:SMS expected
9:TO expected
10:Pending Transaction
11:TID Expected
12:FROM Expected
If the task's response code is not 0, it
indicates that the task is not accepted by
the device.
http://host:port/goip_get_tasks.html?version=xxx&username=root&password=root&port=x
xx&pos=xxx&num=xxx&has_content=xx
5.3.6.2 Parameter
The body of response is a JSON array composed by one or more task ID. Parameter Content-Type
in HTTP head should set to “application/json;charset=utf-8”.
{“tids”:[tid1,tid2,…,tidn]}
Attributes instructions:
Parameter Data Description
Default Required
type
The body of response is a JSON array composed by one or more task ID.
Parameter “Content-Type” in HTTP head should set to“application/json;charset=utf-8”.
{ “ code ” :200, “ reason ” : “ OK ” , “total_num”:n“task_num”:n,
“tasks”:[{“tid”:tid_1, …},…,{“tid”:tid_n, …}]
Attributes instructions:
Parameter Data type Description Default Required
5.4 Example
5.4.1 Status notification
Url:
http://192.168.1.67:80/goip_get_status.html?url=http://192.168.1.142&period=60&username=root&password
=root
Response:
Url: http://192.168.1.67:80/goip_send_cmd.html?Username=root&password=root
Url:
http://192.168.1.67:80/goip_post_sms.html?username=root&password=root
Body:
{"type":"send-sms","task_num":1, "tasks":[{"tid":1223,"to":"13686876620","sms":"hello123"}]}
Response:
Url:
http://192.168.1.67:80/goip_pause_sms.html?username=root&password=root
Body:
{"tids":[2,3]}
Response:
Url:
http://192.168.1.67:80/goip_resume_sms.html?Username=root&password=root
Body:
{"tids":[2,3]}
Response:
Url:
http://192.168.1.67:80/goip_remove_sms.html?Username=root&password=root
Body:
{"tids":[2,3]}
Response:
Url:
http://192.168.1.67:80/goip_get_tasks.html?version=1.1&username=root&password=root&port=1&
pos=0&has_content=1
Response:
6.1 Topology
While forwarding SMS, device send a request to server first, so even device in
LAN, and server in a public net, it also can work effectively
6.2.1 URL
Default set by device,server can revise it in SMS sending quest message.
6.2.2 Parameter
6.2.3 Data
A JSON format string consisting of one or more short messages. The value of the
HTTP header parameter "Content-Type" is “application/json;charset=utf-8”.
{“type”:“recv-sms”,“sms_num”:n, “sms”:[[],…,[]]}
Attributes instructions:
Parameter Data Description
Default Required
type
type String Data type None Y(recv-sms)
sms_num String Total SMS num None Y
sms Array SMS array None Y
7 Query SMS
Customers can actively query the SMS received by the device through HTTP
Document No : xxxxxxx 5/16/2020 Page 27
Version: 2.0
HTTP SMS Development Spec.
GET/POST request.
7.2.1 URL
http://host:port/goip_get_sms.html?username=root&password=root&sms_id=xxx&sms_num=xxx
7.2.2 Parameter
7.2.3 Data
A JSON format string consisting of one or more short messages. The value of the
HTTP header parameter "Content-Type" is“application/json;charset=utf-8”。
{
"code": 0,
"reason": "OK",
"ssrc": "0123456789abcdef",
"sms_num": 2,
"next_sms": 3,
"data":
[
[0, "1B",
1466506477,"10010","13265825775","5bCK5pWs55qE55So5oi377yM5oKo5aW977yB5o6o6I2Q5oKo5L2/55So
Document No : xxxxxxx 5/16/2020 Page 28
Version: 2.0
HTTP SMS Development Spec.
44CQ5omL5py66JCl5Lia5Y6F44CR5LiA56uZ5byP5YWN5rWB6YeP5pyN5Yqh5bmz5Y+wIGh0dHA6Ly91LjEwMDEwLm
NuL2R0Y2Qg77yM6L275p2+5p+l6K+i6K+d6LS544CB5L2Z6aKd5Y+K6K+m5Y2V77yb5oiW5Zue5aSN5Lul5LiL5pWw
5a2X5Luj56CB6I635Y+W5oKo6ZyA6KaB55qE5pyN5Yqh77yaDQoxMDEu5b2T5pyI6K+d6LS577ybDQoxMDIu5Y+v55
So5L2Z6aKd77ybDQowLuWNh+e6pzRH77ybDQoxLuivnei0ueWPiuenr+WIhu+8mw0KMi7otKbmiLfmn6Xor6LvvJsN
CjMu5YWF5YC877ybDQo0LuWuouaIt+acjeWKoe+8mw0KNS7kuJrliqHlip7nkIbvvJsNCjYu5aKe5YC85Lia5Yqh77
ybDQo3LuecgeS7veS4k+WMuu+8mw0KOS7ng63ngrnkv4PplIDjgIINCuW5v+S4nOiBlOmAmuOAggAAAAA="],
[0, "1B",
1466506670,"10010","13265825775","5bCK5pWs55qE55So5oi377yM5oKo5aW977yB5o6o6I2Q5oKo5L2/55So
44CQ5omL5py66JCl5Lia5Y6F44CR5LiA56uZ5byP5YWN5rWB6YeP5pyN5Yqh5bmz5Y+wIGh0dHA6Ly91LjEwMDEwLm
NuL2R0Y2Qg77yM6L275p2+5p+l6K+i6K+d6LS544CB5L2Z6aKd5Y+K6K+m5Y2V77yb5oiW5Zue5aSN5Lul5LiL5pWw
5a2X5Luj56CB6I635Y+W5oKo6ZyA6KaB55qE5pyN5Yqh77yaDQoxMDEu5b2T5pyI6K+d6LS577ybDQoxMDIu5Y+v55
So5L2Z6aKd77ybDQowLuWNh+e6pzRH77ybDQoxLuivnei0ueWPiuenr+WIhu+8mw0KMi7otKbmiLfmn6Xor6LvvJsN
CjMu5YWF5YC877ybDQo0LuWuouaIt+acjeWKoe+8mw0KNS7kuJrliqHlip7nkIbvvJsNCjYu5aKe5YC85Lia5Yqh77
ybDQo3LuecgeS7veS4k+WMuu+8mw0KOS7ng63ngrnkv4PplIDjgIINCuW5v+S4nOiBlOmAmuOAggAAAAA="]
]
}
Property description:
[3] : Sender(If Delivery report flag set to 1, then sender should be SMCC)
[4] : Recipient(If Delivery report flag set to 1,then recipient should be the
original recipient. )
8.1.1 URL
http://host:port/goip_get_sms_stat.html?version=xxx&username=xxx&password=xx
x&p orts=xxx&slots=xxx&type=xxx
8.1.2 Parameter
previous API
1.1 : Support for
the description of this
document
3) 2: today;
4) 3: cumulative;
8.1.3 Response
The body of the response is a JSON array, and the value of the HTTP header parameter
"Content-Type" is“application/json;charset=utf-8”.
{“code”:200,“reason”:“OK”,“count”:n,“stats”:[{“port”:xxx,…},…]}
Property description:
9.1.1 URL
http://host:port/goip_get_call_stat.html?version=xxx&username=xxx&password=x
xx& ports=xxx&slots=xxx&type=xxx
host: Device IP address
port: Device webpage management port, default value is 80.
9.1.2 Parameter
Parameter Description Default Required Remark
(3) 2: today;
(4) 3: cumulative;
9.1.3 Response
The body of the response is a JSON array, and the value of the HTTP header parameter
"Content-Type" is“application/json;charset=utf-8”.
{“code”:200,“reason”:“OK”,“count”:n,“stats”:[{“port”:xxx,…},…]}
Property description:
Parameter Data type Description Default Required
code int Interface processing result code None Y
reason string Interface processing result reason None Y
count int Number of statistical results None Y
stats stat result Array of statistical results (stat
None Y
array results are as follows)