Push Status Records


Function Description


After opening this function, we will push the updated status report to you in time. You need to provide an URL address to accept the http post request. Up to 100 status records can be pushed once. To improve speed, it is better to accept the data first and then processing it.


p.s.


  1. This function does not open by default. If necessary, please set it in the page"Data pull and push".
  1. Suggest to remove the duplicates based on the column "sid".


Data should be received as below steps


  1. decode the data from parameter "sms_status". For example,json_data = urldecode(sms_status) .
  1. return "0" or "SUCCESS" with string type. It will be considered as push failed if you return any other values. We
    will try to re-push every 5 minutes if it is failed. Up to 3 times will push.


Push Method: POST

Content-Type:application/x-www-form-urlencoded;charset=utf-8;


Request Body:

Parameter

Type

Description

sms_status

string

Data in URL-encoded format:sms_status=urlencode(json)


The server pushes the data as below


curl --data "sms_status=url_encode_json" http://your_receive_url_address


Data format for status record JSON representations


[
    {
    	"error_detail": "接收成功",
        "sid": 9527,
        "uid": "abc",
        "user_receive_time": "2014-03-17 22:55:21",
        "error_msg": "DELIVRD",
        "mobile": "15205201314",
        "report_status": "SUCCESS"
    },
    {
    	"error_detail": "接收成功",
        "sid": 9528,
        "uid": "123",
        "user_receive_time": "2014-03-17 22:55:23",
        "error_msg": "DELIVRD",
        "mobile": "+93703334567",
        "report_status": "SUCCESS"
    }
]


Response Parameter List

PARAMETER

TYPE

DESCRIPTION

EXAMPLE

error_detail

string

Details from mobile operators. Use it when report_status is "FAIL" as a reference.

"接收成功"

sid

long(64 bit)

Unique SMS ID

16741236146

uid

string

ID defined by yourself. If not set, it will show null.

"1234567"

user_receive_time

string

SMS receive time

"2014-03-17 22:55:21"

error_msg

string

If SMS does not be received successfully, it will show error code.

""

mobile

string

Mobile

"15205201314"

report_status

string

Report Status. Use it to check message deliver status

"SUCCESS" / "FAIL"


Attention


Please use the parameter as the following steps:


  1. check report_status: "SUCCESS" means the message was delivered SUCCESSfully, otherwise, "FAIL".
  1. if report_status is "FAIL", check error_msg and error_detail.
  1. error_msg and error_detail come from mobile operator. They are not unified. Please regard the two parameters as references when report_status is "FAIL". DO NOT use the two directly.