HTTP API - Query SMS Delivery Status: Difference between revisions

From Ultiroam User Docs
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
Line 64: Line 64:
'''status_code''': delivery status which  ranges from 0 to  255;
'''status_code''': delivery status which  ranges from 0 to  255;


0: it means the SMS has been  received by peer 32 ~ 63: temporary error
0: it means the SMS has been  received by peer  
 
32 ~ 63: temporary error


64~255: permanent error
64~255: permanent error

Latest revision as of 08:03, 8 May 2024

POST https://gateway_ip/api/query_sms_deliver_status

Request Parameters:

Parameter Type Description
Optional Parameter
number Array of Strings The count of telephone numbers should not be more than 32. The length of each number should not exceed 24 bytes
port Array of Integers The port(s) for sending SMS messages

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

Response Parameters:

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 result Results of delivery status; each result includes the following information:

port: port for sending SMS messages

number: destination number

time: time of sending SMS messages

ref_id: reference ID which is used to match SMS sending result

status_code: delivery status which ranges from 0 to 255;

0: it means the SMS has been received by peer

32 ~ 63: temporary error

64~255: permanent error

For more information about status code, please search "SMS Status Report.

imsi: IMSI of the SIM card.

Example of Querying SMS Delivery Status:

Request: curl -k --anyauth -u admin:admin -d '{"number":["12341234"],  "port":[1,2,3], "time_after":"2014-12-12 19:29:19",

"time_before":"2014-12-12 19:29:19"}' -H "Content-Type:  application/json"  https://gateway_ip/api/query_sms_deliver_status

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

0, "number":"12341234","time":"2014-12-21 12:06:01","ref_id":12,

"status_code":0,"imsi":"460004642148063"}]}

Deliver status can also be pushed to your application, like

{"sn":"xxxx-xxxx-xxxx-xxxx","sms_deliver_status":[{"port":1,"n umber":"10086","time":"2016-07-12

15:46:53","ref_id":215,"status_code":0,"imsi":"460004642148063 "}]}