POST API for send and receive sms
1 Public
1.1 Basic Interface Definitions
- The client must send the JSON of the restful api as POST
- The server returns json data in a fixed format.
1.2 API public encapsulation
Client→Server Request
KEY | VAL | Default | Remark |
---|---|---|---|
username | string | – | Account (must be transmitted for authentication) |
password | string | – | Password(must be transmitted for authentication) |
[ANY] | [ANY] | [ANY] | Other parameters are defined by the API function |
Server→Client Response
KEY | VAL | Default | Remark |
---|---|---|---|
uri | string | – | Returns the name of the URI corresponding to the request |
code | int | – | Success or failure identifier |
msg | string | – | Information Alerts |
data | array | – | Data content, defined by API functions |
2 SMS management
2.1 send sms
2.1.1 get slots /sms/get_valid_spans
Get all the ports and request an available port to send an SMS based on the port status.
Client→Server Request
Server→Client Response
DATA_SUBKEY | VAL | Default | Remark | Renew |
---|---|---|---|---|
port | int | Port Value (used when sending SMS) | ||
port_name | string | port name | ||
status | int | Status value: 1 ︓ Available ︔ 0 ︓ Not Available | 240326 |
2.1.2 send sms /sms/send
Client→Server Request
DATA_SUBKEY | VAL | Default | Remark | Renew |
---|---|---|---|---|
spans[] | array | – | Port Value | |
dest_num | string | – | destination number | |
msg | string | – | message content | 240326 |
mode | int | 0 | Status value. 0: Send asynchronously 1: Send synchronously |
Server→Client Response
2.2 SMS status
2.2.1 get sms status in smsoutbox /smsoutbox/get
Client→Server Request
DATA_SUBKEY | VAL | Default | Remark | Renew |
---|---|---|---|---|
current_page | int | 1 | current page | |
phone_number_filter | string | – | phone number | |
start_datetime_filter | datetime | – | start time, format: YY-MM-DD H:i:s | 240326 |
end_datetime_filter | datetime- | end time, format: YY-MM-DD H:i:s |
Server→Client Response
DATA_SUBKEY | VAL | Default | Remark | Renew |
---|---|---|---|---|
port_name | string | – | port name | |
phonenumber | string | – | phone number | |
time | datetime | – | send time | 240326 |
message | string- | – | message content | |
status | string | – | Status values. There are FAILED, SENT, DELIVERD |
2.2.2 Get push SMS status settings /smsoutbox/get_config
Client→Server Request
Server→Client Response
DATA_SUBKEY | VAL | Default | Remark | Renew |
---|---|---|---|---|
enable | int | – | Push switch. 1 On 0 Off | |
reports_enable | int | – | SMS report switch. 1 On 0 Off | |
results_enable | int | – | SMS result switch. 1 On 0 Off | 240326 |
url_http | string | – | url_http name | |
url_host | string | – | url_host name | |
url_port | string | – | url_port name | |
url_path | string | – | url_path name | |
url_from_num | string | – | url_from_num name | |
url_to_num | string | – | url_to_num name | |
url_portname | string | – | url_portname name | |
url_message | string | – | url_message name | |
url_time | string | – | url_time name | |
url_imsi | string | – | url_imsi name | |
url_status | string | — | url_status name | |
url_user_defined | string | – | url_user_defined name |
2.2.3 Save push SMS status settings /smsoutbox/set_config
Client→Server Request
DATA_SUBKEY | VAL | Default | Remark | Renew |
---|---|---|---|---|
enable | int | – | Push switch. 1 On 0 Off | |
reports_enable | int | – | SMS report switch. 1 On 0 Off | |
results_enable | int | – | SMS result switch. 1 On 0 Off | 240326 |
url_http | string | – | url_http name | |
url_host | string | – | url_host name | |
url_port | string | – | url_port name | |
url_path | string | – | url_path name | |
url_from_num | string | – | url_from_num name | |
url_to_num | string | – | url_to_num name | |
url_portname | string | – | url_portname name | |
url_message | string | – | url_message name | |
url_time | string | – | url_time name | |
url_imsi | string | – | url_imsi name | |
url_status | string | — | url_status name | |
url_user_defined | string | – | url_user_defined name |
Server→Client Response