SMS API (Get Method)
The SMS API Get method will be gradually replaced by the new API using the Post method. The API with the Get method will be deprecated in upcoming versions soon.
Therefore, please give priority to using the Post Method.
1.1 sendsms
send sms asynchronously via async_sms tool. This is the http to sms interface:
http://ip:port/sendsms?username=xxx&password=xxx&phonenumber=xxx&message=xxx&[port=xxx&][report=xxx&][timeout=xxx&][id=xxx]
name | description | Required fields | remark |
username | username | yes | You need to verify the username when sending SMS, configure it in the Web GUI |
password | password | yes | You need to verify the password when sending SMS, configure it in the Web GUI |
message | SMS content | yes | SMS content |
phonenumber |
destination phone number | yes | The destination number to send to.
There can be more than one number, and use “,”to separate |
port | port number | no | The channel on which the message is sent, the card on the channel must be registered.
There can be more than one channel, and use “,”to separate |
report | result report | no | GET return result display format, JSON/STRING/NO |
timeout | timeout | no | Timeout for sending SMS |
id | unique ID | no | Associate this ID when receiving SMS results |
request
http://172.16.2.85:80/sendsms?username=smsuser&password=smspwd&phonenumber=13715103042&message=test&port=16&report=STRING&timeout=3000&id=123
response
message:test
--record 1 start--
port: 16
phonenumber: 13715103042
time: 2024-11-20 14:20:29
id: 123
result: sending
--record 1 end--
1.2 push SMS or report
Push incoming sms, or push asynchronous sms delivery result, or push sms report.
This is an sms to http interface, which requires the client to build its own http/https server to receive the pushed content.
http://ip:port/path?param1=${phonenumber}¶m2=${port}¶m3=${portname}¶m4=${message}¶m5=${time}¶m6=${imsi}¶m7=${status}[&{UserDefined}]
name | description | Required fields | remark |
path | Received tools and paths | yes | |
param1 | Name of the sending number | yes | By this name the sending number is indicated; for example, configure as phonenumber |
param2 | Name of the channel number | yes | The channel number is indicated by this name; for example, configure as port |
param3 | Name of the channel name | no | Indicate the channel name by this name; for example, configure as portname |
param4 | name for SMS | no | The SMS content is indicated by this name; for example, configure as message |
param5 | time name | no | By this name the time of USSD reception is indicated; for example, configure as time |
param6 | IMSI name | no | IMSI by this name; for example, configure as imsi |
param7 | status name | no | This name indicates the result of sending the status of the SMS; for example, configure as status |
UserDefined | User defined | no |
These names need to be the same on the http/https server as they are on the Web GUI.
request
http://172.16.2.43/receivesms.php?phonenumber=${phonenumber}&port=${port}&portname=${portname}&message=${message}&time=${time}&imsi=${imsi}&status=${status}&id=${id}
1.3 smsstatus
Get SMS Report
http://ip:port/service?action=smsstatus&username=xxx&password=xxx&phonenumber=xxx&id=xxx
name | description | Required fields | remark |
username | username | yes | You need to verify the username when sending SMS, configure it in the Web GUI |
password | password | yes | You need to verify the password when sending SMS, configure it in the Web GUI |
phonenumber | destination phone number | yes | Destination number |
id | unique ID | yes | This ID is associated with the result of the received SMS and the SMS report. |
request
http://172.16.2.85/service?action=smsstatus&username=smsuser&password=smspwd&phonenumber=13715103042&id=123
1.4 sendussd
send ussd
http://ip:port/sendussd?username=xxx&password=xxx&message=xxx&[port=xxx&][timeout=xxx&][id=xxx]
name | description | Required fields | remark |
username | username | yes | You need to verify the username when sending SMS, configure it in the Web GUI |
password | password | yes | You need to verify the password when sending SMS, configure it in the Web GUI |
message | ussd content | yes | ussd content |
port | port number | no | The channel on which the transmission takes place, the card on the channel must be registered |
timeout | timeout | no | Send USSD Timeout |
id | unique ID | no | Associate this ID when receiving USSD results |
request
http://172.16.2.85/sendussd?username=ussduser&password=ussdpwd&message=*%23301&port=16&timeout=3000&id=123
response
{ "message":"*#301", "report":[{ "1":[{ "port":"16", "time":"2024-11-20 14:59:40", "id":"123", "result":"sending" }] }] }
1.5 push ussd result
push ussd result
This is the ussd to http interface, which requires clients to build their own http/https servers to receive the pushed content.
http://ip:port/path?param1=${port}¶m2=${message}¶m3=${time}¶m4=${status}¶m5=${code}¶m6=${id}[&{UserDefined}]
name | description | Required fields | remark |
path | Received tools and paths | yes | |
param1 | Name of the channel number | yes | The channel number is indicated by this name; for example, configure as port |
param2 | ussd content | no | The USSD content is indicated by this name; for example, configure as message |
param3 | time name | no | By this name the time of USSD reception is indicated; for example, configure as time |
param4 | status name | no | This name indicates the result of sending the status of the SMS; for example, configure as status |
param5 | result code name | no | The USSD code result value is indicated by this name, e.g., configure as code |
param6 | id | no | By this name represents the unique value, associated with the id at the time of sending |
UserDefined | User defined | no |
request
http://172.16.2.43/receiveussd.php?port=${port}&message=${message}&time=${time}&status=${status}&code=${code}&id=${id}
1.6 chan_state
Get channel status
http://ip:port/service?action=chan_state&username=xxx&password=xxx
name | description | Required fields | remark |
username | username | yes | You need to verify the username when sending SMS, configure it in the Web GUI |
password | password | yes | You need to verify the password when sending SMS, configure it in the Web GUI |
request
http://172.16.2.85/service?action=chan_state&username=admin&password=admin
response
{ "The total idle channels": "2", "Detailed channel state": [ { "1": "1", "2": "1", "3": "1", "4": "1", "5": "1", "6": "1", "7": "1", "8": "1", "9": "1", "10": "1", "11": "1", "12": "1", "13": "1", "14": "1", "15": "0", "16": "0", "17": "1", "18": "1", "19": "1", "20": "1", "21": "1", "22": "1", "23": "1", "24": "1", "25": "1", "26": "1", "27": "1", "28": "1", "29": "1", "30": "1", "31": "1", "32": "1" } ] }
1.7 simstatus
Get SIM card status and IMSI number
http://ip:port/service?action=simstatus&port=xxx
name | description | Required fields | remark |
port | port number | yes | channel number.
When = 0, get the SIM card status for all channels; When >0, get the SIM card status of the current channel; |
request
http://172.16.2.85/service?action=simstatus&port=16
response
{ "16":[{ "imsi":"460078026718248", "status":"Registered (Home network)" }] }