Send Template SMS¶
This interface for operators by specified text messages sent a particular template text messages, custom template text of parameters for the caller to replace part of the text operators can increase the message signature, before the body of the request is sent successfully, SMS sending requests will be put into the message queue, users can receive a eventId, follow-up can be sent via eventId view the actual results.
Request Format¶
POST https://{apigw-address}/notification-center-service/v2.0/template/sms
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Mandatory |
String |
The organization ID. How to get the orgId>> |
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
variables |
Mandatory |
Map<String, String> |
The variables that need to be used in the SMS template can be checked in EnOS Console to select Notification Management > SMS > SMS Template |
templateCode |
Mandatory |
String |
Template identifier(Identifier) |
phones |
Mandatory |
List<Phone> |
The recipient’s mobile area code and telephone number |
tunnelCode |
Mandatory |
String |
Specify the operator to send SMS, refer to the operator configuration instructions below for details |
signatureCode |
Optional |
String |
To send SMS messages, you need to add the display of SMS signature before SMS. You need to go to EnOS Console to select Notification Management > SMS > Signatures page to view. Different ou and suppliers have different configurations |
priority |
Optional |
Enum |
Message sending priority, P2 by default, no special configuration required |
Response Parameters¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
eventId |
Mandatory |
String |
An eventId that returns the result for the user to query when a mail or SMS request is sent |
Error Codes ¶
Code |
Data Type |
Description |
---|---|---|
32404 |
signature is not exist |
The SMS signature does not exist |
32404 |
sms template is not exist |
The SMS template does not exist |
32400 |
variable not in template |
Error customizing variable in template |
32400 |
tunnel code is not existed |
Message channel parameter error |
32435 |
operation not allowed, the signature is not approved |
The SMS signature was not approved |
Samples¶
Request Sample¶
url: https://{apigw-address}/notification-center-service/v2.0/template/sms?orgId=yourOrgId
method: POST
requestBody:
{
"variables": {
"aaa": "xxx"
},
"signatureCode": "xx",
"phones": [
{
"area": "87",
"number": "23"
}
],
"templateCode": "awyfl",
"priority": "P2",
"tunnelCode": ""
}
Return Sample¶
{"code":0, "msg":"OK", "submsg":"", "requestId": null, "data":{"eventId": "evt16062008765401}}
Abnormal Sample¶
{"code":32403, "msg":"the quota is run out, test quota is limited", "submsg":"Permission denied: tunnel.quota.run.out", "data": null, "requestId": null}