tencent cloud

Tencent Cloud Super App as a Service

Release Notes and Announcements
Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Pay-As-You-Go Billing
Renewal Guide
Service Suspension Instructions
Getting Started
Plan Management
Overview
Console Account Management
Storage Configuration
Acceleration Configuration
Branding Configurations
Platform Features
Console Login
Users and Permission System
Mini Program Management
Mini Game Management
Superapp Management
Commercialization
Platform Management
User Management
Team Management
Operations Management
Security Center
Code Integration Guide
Getting Demo and SDK
Android
iOS
Flutter
Superapp Server
GUID Generation Rules
Mini Program Development Guide
Mini Program Introduction and Development Environment
Mini Program Code Composition
Guide
Framework
Components
API
Server Backend
JS SDK
Base Library
IDE Operation Instructions
Mini Game Development Guide
Guide
API
Server Backend
Practice Tutorial
Mini Program Login Practical Tutorial
Mini Program Subscription Message Practical Tutorial
Payment Practical Tutorial
Ad Integration Practical Tutorial
Mini Game Subscription Message Practical Tutorial
API Documentation
History
Introduction
API Category
Making API Requests
Operation Management APIs
User Management APIs
Team Management APIs
Sensitive API-Related APIs
Role Management APIs
Platform Management APIs
Other Console APIs
Mini Program or Mini Game APIs
Management-Sensitive APIs
Global Domain Management APIs
Superapp APIs
Data Types
Agreements
Service Level Agreement
Data Processing and Security Agreement
SDK Privacy Policy Module
SDK Data Processing and Security Agreement Module

Subscription Message

PDF
Focus Mode
Font Size
Last updated: 2025-01-17 11:04:26



Note:
Only supported on SaaS.

Query personal template list

Request method: Get
Request URL: /openserver/wxaapi/newtmpl/gettemplate

Request parameters

Property
Type
‍Required
Description
access_token
string
True
Access token

Response parameters

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"
}

Send subscription messages

Request method: Post
Request URL: /openserver/cgi-bin/message/subscribe/send

Request parameters

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).

Response parameters

Property
Type.
Description
errcode
number
Error code.
errmsg
string
Error message.
{"errcode":0,"errmsg":"ok"}

Additional description

Subscription message parameter value limitations

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}$
For example, the content of the template could be:
Name: {{name01.DATA}}
Amount: {{amount01.DATA}}
Itinerary: {{thing01.DATA}}
Date: {{date01.DATA}}
The corresponding JSON:
{
"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"
}
}
}




Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback