Actions18
Overview
This node interacts with the WeChat Official Account API, specifically focusing on managing permanent media assets ("素材管理"). The "获取永久素材" (Get Permanent Material) operation allows users to retrieve a permanent media asset by specifying its unique media ID. This is useful in scenarios where you need to fetch stored images, videos, or other media types from your WeChat account for further processing, display, or distribution.
Practical examples include:
- Automatically retrieving a stored promotional image to include in a message campaign.
- Fetching video content previously uploaded to WeChat for embedding in newsletters.
- Accessing permanent media files to verify or update content without manual downloads.
Properties
| Name | Meaning |
|---|---|
| 媒体ID | The unique media ID of the permanent material to retrieve. This is required and must be provided to fetch the specific media asset. |
Output
The node outputs the retrieved permanent media asset in the json output field. The structure typically includes metadata about the media and the media content itself, depending on the type of material requested. If the media is binary (e.g., images, videos), the node will provide the binary data accordingly, allowing downstream nodes to process or save the media file.
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 configuration of the WeChat API credentials within n8n is necessary to enable successful communication.
Troubleshooting
Common Issues:
- Invalid or expired media ID: Ensure the media ID provided exists and is correct.
- Authentication errors: Verify that the API key credential is valid and has the necessary permissions.
- Network or API endpoint issues: Confirm network connectivity and that the WeChat API service is operational.
Error Messages:
- Errors related to missing or invalid
media_idindicate that the input property was not set correctly. - Authentication failures usually suggest problems with the API key or token; re-authenticate or update credentials as needed.
- API rate limits or quota exceeded errors require waiting or adjusting usage patterns.
- Errors related to missing or invalid
Links and References
- WeChat Official Account API Documentation (for permanent media management)
- n8n Documentation on Credentials (for setting up API keys)