HTTP API - Query SMS Sending Result

From Ultiroam User Docs
Revision as of 23:16, 30 April 2024 by Administrator (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

POST https://gateway_ip/api/query_sms_result

Request Parameters:

Parameter Type Description
Optional Parameters
number Array of Strings The number of the string arrays should not exceed 32, while the length of each string should not be more than 24 bytes.
port Array of Integers The port(s) for sending SMS

Each port should be an integer ranging from 0 to 31

time_after String String like "YYYY-MM-DD HH:MM:SS"

Query the records of SMS messages sent after this time

time_before String String like "YYYY-MM-DD HH:MM:SS";

Query the records of SMS messages sent before this time

user_id Array of Integers Each user ID here is used to match the user ID carried in Send Sms Request

This user_id is the unique value which is set during sending SMS. (refer to “send SMS”, “Request parameters”)

This parameter is recommended for practice.

Response Parameter:

Parameter Type Description
error_code Integer Codes that may be returned:

200: Request has been accepted and processed 400: Request format is not valid

413: the count of telephone numbers is more than 32

500: other errors

sn String SN of the gateway
result Array of Objects Results of SMS sending; Each result includes the following information:

port: port for sending SMS

number: destination number of the sent SMS

user_id:   match with the user ID carried in SMS sending request

time: the time of sending SMS

status: sending status, which could be FAILED,

SENDING, SENT_OK and DELIVERED

count: count of SMS segments. A long SMS message is divided into several segments and then is sent.

succ_count: count of SMS segments that are sent successfully

ref_id: the first reference ID of this SMS, which is used to match SMS delivery status.

The range of reference ID is from 0 to 255.

Referend ID is generally used together with telephone number, portnumber and even sending time to match a delivery

status.

Imsi: IMSI of the SIM card.

Example of Querying SMS Sending Result:

Request:

curl -k --anyauth -u admin:admin -d '{"user_id":[1,2]}' -H  "Content-Type: application/json"  https://gateway_ip/api/query_sms_result

Response:

{"error_code":200,"sn":"xxxx-xxxx-xxxx-xxxx","result":[{"port":

0,"user_id":1,"number":"12351","time":"2014-12-21

12:06:01","status":"SENT_OK","count":3, "succ_count":3,  "ref_id":12,"imsi":"460004642148063"}]}

Sms result can also be pushed to your application, like:

{"sn":"xxxx-xxxx-xxxx-xxxx","sms_result":[{"port":1,"number":" 10086","time":"2016-07-12

01:46:02","status":"DELIVERED","count":1,"succ_count":1,"ref_i d":215,"imsi":"460004642148063"}]}