# Send a subscription notification
Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide
Interface name: sendNewSubscribeMsg
Send a subscription notification
# 1. How to call
# HTTPS calls
POST https://api.weixin.qq.com/cgi-bin/message/subscribe/bizsend?access_token=ACCESS_TOKEN
# Cloud Calls
Call method: subscribeMessage.bizsend
The input and exit parameters are the same as the HTTPS call, which can be called in the cloud call documentation
# Third party invocation
This interface supports Third Party Platform generation business call.
The permission set to which this interface belongs is id: 89
When a service provider is authorized by one of the permissions set, it can call on behalf of the merchant by using authorizer_access_token , which can be viewed in the third-party call documentation.
# 2. Request parameters
# Query parametersQuery String parameters
| Parameter Name | type | Required to fill in | Introductions |
|---|---|---|---|
| access_token | string | yes | Interface invocation credentials, using access_token , authorizer_access_token |
# Request BodyRequest Payload
| Parameter Name | type | Required to fill in | Introductions |
|---|---|---|---|
| template_id | string | yes | Required subscription template id |
| page | string | no | Click the template card after the jump page, only in this Weixin Mini Program pages.Support with parameters, (example index?foo=bar)。If the field is not filled, there are no bounces on the template |
| touser | string | yes | Receiver (user) openid |
| data | object | yes | Template content, formatting like { "phrase3": { "value": "approved" }, "name1": { "value": "subscription" }, "date2": { "value": "2019-12-25 09:42" } } |
| miniprogram_state | string | yes | Jump Weixin Mini Program Type: developer for development version;Trial for the experience version; Formal version; By default, the official version is |
| lang | string | yes | Go to Weixin Mini Program to view”Support zh_CN (Simplified Chinese), en_US (English), zh_HK (Traditional Chinese), zh_TW (Traditional Chinese), default to zh_CN |
# Body.dataObject Payload
Template content, formatting like { "phrase3": { "value": "approved" }, "name1": { "value": "subscription" }, "date2": { "value": "2019-12-25 09:42" } }
| Parameter Name | type | Required to fill in | Introductions |
|---|---|---|---|
| thing.DATA | string | no | Things can be combined with Chinese characters, numbers, letters or symbols, within 20 characters |
| number.DATA | number | no | Numbers, only numbers, mixed decimal, 32 digits or less |
| symbol.DATA | string | no | Symbols, within 5 bits, common symbols other than Chinese, English, and numbers, and cannot carry control characters such as changing lines |
| character_string.DATA | string | no | Character string, which can be a combination of numbers, letters, or symbols up to 32 bits |
| time.DATA | string | no | Time, 24-hour time format (supported + year and day), support for HH: MM: SS or HH:MM, support for filling time periods, connect between two time points with a "~" symbol, for example: "15:01" or "15:01 October 1, 2019" |
| date.DATA | string | no | Date, year-day format (support + 24-hour time), support for filling time periods, and use '-', '/, '.' symbols to connect between two time points, such as: "October 1, 2019" or "October 1, 2019, 15: 01" |
| amount.DATA | string | no | Amount, 1 currency sign + no more than 10 pure digits, can be mixed decimal, the end can be "yuan" |
| phone_number.DATA | string | no | Phone number, within 17 numbers, numerals, symbols, Example: + 866-0766-66888866 |
| car_number.DATA | string | no | License plate number, less than 8 digits, the first and last digits can be Chinese characters, the rest are letters or numbers, such as: Guangdong A8Z888 |
| name.DATA | string | no | Name, Chinese name within 10 characters; A pure English name in 20 letters; Mixed Chinese and alphabets count by Chinese name, within 10 words |
| phrase.DATA | string | no | Chinese characters, within 5 pure Chinese characters, for example: in distribution |
| letter.DATA | string | no | Letters, letters within 32 bits |
# 3. Return Parameters
# Response Payload
| Parameter Name | type | Introductions |
|---|---|---|
| errcode | number | Error code |
| errmsg | string | Error Description |
# 4. Note
There are no special considerations for this interface
# 5. Code examples
Example Requests
{
"touser":"OPENID",
"template_id":"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY",
"page":"http://weixin.qq.com/download",
"miniprogram":{
"appid":"xiaochengxuappid12345",
"pagepath":"index?foo=bar"
},
"client_msg_id":"MSG_000001",
"data":{
"keyword1":{
"value":"巧克力"
},
"keyword2": {
"value":"39.8元"
},
"keyword3": {
"value":"2014年9月22日"
}
}
}
Return an example
{
"errcode":0,
"errmsg":"ok"
}
# 6. Error code
There is no special error code for this interface, see General error code
# 7. Scope of application
| Official Account | Service Account |
|---|---|
| Certification only | Certification only |
- Authentication only: means that only authenticated accounts are allowed to be invoked by the enterprise entity, and accounts that are not authenticated or do not support authentication cannot be invoked.
- Other account types that are not expressly stated may not be called on this interface without special instructions;