Send SMS Template


This interface for providers by specified text messages sent a particular template text messages, custom template text of parameters for the caller to replace part of the text providers 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)

Required/Optional

Data Type

Description

orgId

Query

Required

String

The organization ID. How to get the orgId>>

Request Parameters (Body)


Name

Required/Optional

Data Type

Description

variables

Required

Map<String, String>

The variables that need to be used in the SMS template can be checked in EnOS Management Console to select Notification Management > Messages > Templates.

templateCode

Required

String

Template identifier (Identifier)

phones

Required

List<Phone>

The recipient’s mobile area code and telephone number.

tunnelCode

Optional, required if tunnelIdentifier is not specified.

String

SMS channel codes, all available channel codes are listed in Useful Constants > SMS Tunnel Code. Specify at least one of tunnelCode and tunnelIdentifier. If both are specified at the same time and conflict, tunnelIdentifier will prevail.

tunnelIdentifier

Optional, required if tunnelCode is not specified.

String

SMS channel ID, used to specify different SMS channels of the same operator (limited to channels defined in the specified OU and system OU). If not specified, defaults to null. Specify at least one of tunnelCode and tunnelIdentifier. If both are specified at the same time and conflict, tunnelIdentifier will prevail.

signatureCode

Optional

String

To send SMS messages, you need to add the display of SMS signature before SMS. You need to go to EnOS Management Console to select Notification Management > Messages > Configurations > 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

Required/Optional

Data Type

Description

eventId

Required

String

An eventId that returns the result for the user to query when a mail or SMS request is sent.

Useful Constants


Name

Value

Description

SMS Tunnel code

  • System: NOTICE_GW

  • OU: HDB_SCS, TWILIO, NEXMO, GENERIC

SMS channel code. System channel codes are available in all OUs. The OU channel code is the operator code of the channel that has been set up in this OU.

Email sender code

NOTICE_GW

Mail sender code, system default, available in all OUs.

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}