TemplateSmsReport

Updated at:

You can specify an HTTP URL to receive SMS template review statuses. When a template's review status changes, the platform pushes the status details to the URL that you provide. You must accept the message and respond in the format required by the platform.

Usage notes

To receive SMS template review statuses over HTTP, go to the Short Message Service console, enable the Receive Template Review Status Messages option, and configure a Receiving Address. For more information about configuring receipts, see Receipt Message Configuration.

Parameters

The parameters are in JSON array format. Each request contains only one template review status report.

Protocol description

Parameter

Description

Request protocol

HTTP

Request format

application/json

Encoding

UTF-8

Parameter example

[
  {
    "template_type": "Captcha",
    "reason": "test",
    "template_name": "SMS test template 1957",
    "orderId": "205101",
    "template_content": "Signature test",
    "template_status": "approved",
    "remark": "test",
    "template_code": "SMS_123123242",
    "create_date": "2019-05-30 19:58:25"
  }
]

Field descriptions

Name

Type

Required

Example

Description

template_type

String

Yes

Captcha

The template type.

reason

String

No

test

The reason for rejection.

template_name

String

Yes

SMS test template 1957

The template name.

orderId

String

Yes

205101

The template review ticket number.

template_content

String

Yes

Signature test

The template content.

template_status

String

Yes

approved

The review status of the template:

  • approving: The template is under review.

  • Approved: The item is approved.

  • rejected: The review was not approved.

remark

String

No

test

The request description.

template_code

String

Yes

SMS_123123242

The template code.

create_date

String

Yes

2019-05-30 19:58:25

The date and time when the template was created.

Response description

After your HTTP endpoint receives the request parameters, it must respond in the following format.

Response example

{
  "code" : 0,
  "msg" : "Accepted successfully"
}

Field descriptions

Name

Type

Required

Example

Description

code

Number

Yes

0

Acknowledgement code. The system only checks if the code is a number and does not validate its content.

msg

String

No

Accepted successfully

Description.

Note
  • If the HTTP status code is 200, the request is successful. If the HTTP status code is not 200 or a timeout occurs, the system retries the push.

  • If a system error or consumption failure occurs, return an HTTP 50X status code.

Push retries

If a push fails, the system retries after 1 minute, 5 minutes, and 10 minutes. If the push still fails after these three attempts, the system does not retry.

Report receiving example

@PostMapping("/resMsg")
public JSONObject resMsg(@RequestBody JSONArray array) {
   // TODO: You must process the delivery receipt message. This example only prints the receipt information.
   System.out.println(array.toJSONString());
   JSONObject json = new JSONObject();
   json.put("code", 0);
   json.put("msg", "Received successfully");
   return json;
}