微信公众号 icon

微信公众号

微信公众号 API

Overview

This node integrates with the WeChat Official Account API to manage media assets. Specifically, for the "素材管理" (Asset Management) resource and the "新增永久素材" (Add Permanent Material) operation, it allows users to upload permanent media files such as images, videos, voice recordings, or news articles to their WeChat Official Account.

Common scenarios include:

  • Uploading promotional images or videos to be used in official posts.
  • Adding voice messages or audio clips for customer engagement.
  • Managing rich media content like news articles for broadcast.

Practical example:
A marketing team wants to upload a new product image permanently to their WeChat account so it can be reused in multiple campaigns without re-uploading each time. They would use this node to upload the image file once and then reference it in subsequent messaging workflows.

Properties

Name Meaning
素材类型 The type of media to upload. Options: 图片 (image), 视频 (video), 语音 (voice), 图文 (news).
素材文件字段 The name of the input field containing the media file stream to upload. Default is "data".

Output

The node outputs JSON data representing the response from the WeChat API after uploading the permanent media. This typically includes identifiers such as media IDs that can be used to reference the uploaded asset in future operations.

If the media includes binary data (e.g., the uploaded file), it is handled via the specified input field but the output focuses on metadata returned by the API.

Dependencies

  • Requires an active connection to the WeChat Official Account API.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • The base URL defaults to https://api.weixin.qq.com/cgi-bin/ unless overridden in credentials.

Troubleshooting

  • Invalid media type error: Ensure the selected media type matches one of the supported options (image, video, voice, news).
  • File not found or empty: Verify that the input field specified in "素材文件字段" contains valid binary data.
  • Authentication errors: Confirm that the API credentials are correctly set up and have sufficient permissions.
  • API rate limits: Be aware of WeChat API limits; excessive uploads may result in temporary blocks.
  • Unsupported media format: Check that the media file format complies with WeChat's requirements (e.g., supported image/video codecs).

Links and References

Discussion