/openserver/wxaapi/newtmpl/gettemplate
Property | Type | Required | Description |
access_token | string | True | Access token |
Property | Type | Description |
errmsg | string | Error message. |
errcode | int32 | Error code. |
data | array<object> | Template list. |
data.priTmplId | string | Template ID. |
data.title | string | Title. |
data.content | string | Content. |
data.example | string | Example. |
data.type | string | Type. |
data.keywordEnumValueList | array<object> | Enumeration list. |
data.keywordEnumValueList.keywordCode | string | Enumeration name. |
data.keywordEnumValueList.enumValueList | array<string> | Enumeration values. |
{"data": [{"content": "testtest400:{{phrase1.DATA}}\ntesttest401:{{phrase2.DATA}}","example": "testtest400:testtest400\ntesttest401:testtest401","keywordEnumValueList": [{"enumValueList": ["To be paid","Wait for delivery","Has been shipped","Completed","Canceled"],"keywordCode": "enum.DATA"}],"priTmplId": "mti_oAWECeEacUIdYvUxSbJBNbkOIfzJHEcJIRSEMAE","title": "testtest400","type": 3},{"content": "Order Number:{{thing1.DATA}}\nOrder type:{{thing2.DATA}}\nOrder Time:{{date.DATA}}\nOrder status:{{phrase.DATA}}","example": "Order Number:100020241130100001\nOrder type:Personal order\nOrder Time:2024/11/30 11:19:00\nOrder status:Pending shipment","keywordEnumValueList": [{"enumValueList": ["To be paid","Wait for delivery","Has been shipped","Completed","Canceled"],"keywordCode": "enum.DATA"}],"priTmplId": "mti_AgKglmMmSMbFVXBpaFunPSIoDGddPKSFGbSAYRe","title": "Received order notification","type": 2}],"errcode": 0,"errmsg": "ok","requestId": "19d63f1109f24857961de213bcfc7e75"}
/openserver/cgi-bin/message/subscribe/send
Property | Type. | Required | Description |
access_token | string | True | Access token for the API call. This parameter should be in the URL, not in the body. |
template_id | string | True | The ID of the subscription template to be sent. |
page | string | False | The page to navigate to when the template card is clicked. This must be a page within the mini program. Parameters can be included (e.g. index?foo=bar). If not provided, the template will not have a navigation link. |
touser | string | True | The OpenID of the recipient (user). |
data | string | True | Template content. |
miniprogram_state | string | True | The type of mini program to navigate to: developer for the development version, trial for the Preview, formal for the official version. Defaults to the official version. |
lang | string | True | Language types viewed in the mini program. Supported values are zh_CN (Simplified Chinese) and en_US (English). |
Property | Type. | Description |
errcode | number | Error code. |
errmsg | string | Error message. |
{"errcode":0,"errmsg":"ok"}
Parameter | Category | Parameter value limitations | Regular Expression |
thing.DATA | Thing | Up to 20 characters | ^[a-zA-Z0-9!@#$%^&*()_+={}\[\]:;\"\'<>,.?/~`-]{1,20}$ |
number.DATA | Number | Up to 32 numbers | ^[0-9]{1,32}(\.[0-9]+)?$ |
letter.DATA | Letter | Up to 32 letters | ^[a-zA-Z]{1,32}$ |
symbol.DATA | Symbol | Up to 5 symbols | ^[^\w\s]{1,5}$ |
character_string.DATA | String | Up to 64 characters | ^[a-zA-Z0-9\W_]{1,64}$ |
time.DATA | Time | 24-hour time format, two times connected by a "~" symbol, format: hh: mm: ss or hh: mm | ^(?:(?:([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?(?:~([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?)?)?)?$ |
date.DATA | Date | In the format of year, month, and day, connect two time with a "~" symbol. such as yyyy-MM-dd hh:mm:ss or yyyy-MM-dd | ^(\d{4}-[01]\d-[0-3]\d(?: (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d)?)(?:~(\d{4}-[01]\d-[0-3]\d(?: (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d)?))?$ |
amount.DATA | Amount | 1 currency symbol plus numbers with up to 10 numbers, and decimals are supported | ^[A-Za-z$€¥]{1}[\d]{0,8}(\.\d{1,2})?$ |
phone_number.DATA | Phone number | Up to 17 characters. Numbers and symbols are allowed. | ^[\d\-\+$$\s]{1,17}$ |
car_number.DATA | Car plate | Up to 12 characters | ^.{1,12}$ |
name.DATA | Name | Up to 32 characters | ^. {1,32}$ |
phrase.DATA | Description | Up to 16 characters | ^.{1,16}$ |
Name: {{name01.DATA}}Amount: {{amount01.DATA}}Itinerary: {{thing01.DATA}}Date: {{date01.DATA}}
{"touser": "OPENID","template_id": "TEMPLATE_ID","page": "index","data": {"name01": {"value": "XX"},"amount01": {"value": "$100"},"thing01": {"value": "Guangzhou to Beijing"},"date01": {"value": "2018-01-01"}}}