微信公众号 icon

微信公众号

微信公众号 API

Overview

This node interacts with the WeChat Official Account API to retrieve a list of media assets (素材) managed by the account. Specifically, the "获取素材列表" (Get Media List) operation under the "素材管理" (Asset Management) resource allows users to fetch a paginated list of media items such as images, videos, voice recordings, or news articles.

Common scenarios for this node include:

  • Synchronizing media assets from a WeChat Official Account into another system.
  • Displaying or processing media content stored in WeChat within an automation workflow.
  • Managing and auditing media resources by retrieving their metadata in bulk.

For example, a marketing team could use this node to automatically pull the latest 20 images uploaded to their WeChat account for inclusion in newsletters or social media posts.

Properties

Name Meaning
素材类型 The type of media asset to retrieve. Options: 图片 (image), 视频 (video), 语音 (voice), 图文 (news).
偏移位置 Offset position to start returning media from. 0 means starting from the first media item.
返回素材数量 Number of media items to return. Must be between 1 and 20.

Output

The node outputs a JSON object containing the list of media assets retrieved from the WeChat API. This typically includes metadata about each media item such as its ID, type, update time, and possibly URLs or other relevant details depending on the media type.

If the media includes binary data (e.g., images or videos), the node may provide references or URLs to access that binary content rather than embedding it directly.

Dependencies

  • Requires an API key credential for authenticating with the WeChat Official Account API.
  • The node uses the base URL https://api.weixin.qq.com/cgi-bin/ for API requests.
  • Proper permissions on the WeChat Official Account are necessary to access media management endpoints.

Troubleshooting

  • Invalid Credentials: If authentication fails, verify that the provided API key or token is correct and has sufficient permissions.
  • Offset Out of Range: Providing an offset larger than the total number of media items will result in empty results. Adjust the offset accordingly.
  • Count Limits: The count must be between 1 and 20; values outside this range will cause errors.
  • API Rate Limits: Frequent calls to the media list endpoint may hit WeChat API rate limits. Implement retries or backoff strategies if needed.
  • Network Issues: Ensure network connectivity to the WeChat API endpoint.

Links and References

Discussion