WeChat

Interact with WeChat API

Send Subscription Message

AI-generated

Overview

This node operation sends a subscription message to a specified WeChat user using the WeChat API. It is useful for scenarios where automated notifications or updates need to be sent to users who have subscribed to a service or application. For example, sending order status updates, event reminders, or personalized alerts to users via WeChat subscription messages.

Use Case Examples

  1. Sending a subscription message to notify a user about a new product launch.
  2. Sending a reminder message to a user about an upcoming appointment.

Properties

Name Meaning
To User (OpenID) The OpenID of the receiver, identifying the WeChat user to whom the subscription message will be sent.
Template ID The ID of the message template to be used for the subscription message, defining the message format and content placeholders.
Data (JSON) The template data in JSON format, providing the dynamic content to fill the placeholders in the message template.
Page URL The URL to redirect the user to when they click the subscription message, typically a page within the application or website.

Output

JSON

  • touser - The OpenID of the message recipient.
  • template_id - The ID of the template used for the subscription message.
  • data - The JSON data used to populate the template placeholders.
  • page - The optional URL to redirect the user when they click the message.
  • errcode - Error code returned by the WeChat API, 0 indicates success.
  • errmsg - Error message returned by the WeChat API, providing details if an error occurred.

Dependencies

  • WeChat API credentials including appId and appSecret for authentication.

Troubleshooting

  • Common issues include invalid or expired access tokens, which result in API errors. Refreshing the token or checking credentials can resolve this.
  • Invalid JSON format in the 'Data (JSON)' property will cause parsing errors; ensure the JSON is correctly formatted.
  • API errors from WeChat include error codes and messages; these should be reviewed to understand the cause, such as invalid template ID or user OpenID.

Links

Discussion