Actions4
- Material Actions
- Draft Actions
Overview
This node integrates with the WeChat Official Account API to upload image materials. Specifically, the Material - Upload Image operation allows users to upload images either by providing Base64 encoded image data or by specifying an image URL. This is useful for managing media assets in a WeChat Official Account, such as preparing images for posts, messages, or other content published through the account.
Common scenarios include:
- Automating the upload of images stored locally or generated dynamically (via Base64).
- Uploading images hosted on external servers by URL.
- Preparing media content for use in WeChat campaigns, articles, or customer interactions.
Example: A marketing automation workflow that uploads product images to WeChat before sending promotional messages.
Properties
| Name | Meaning |
|---|---|
| Input Type | Choose the type of image input: - Base64 Encoded Data - Image URL |
| Image File | The image file path or Base64 encoded string to upload (required if Input Type is Base64) |
| Image URL | The URL of the image to upload (supports jpg/png, max size 1MB; required if Input Type is URL) |
Output
The node outputs a JSON object containing the response from the WeChat API after uploading the image. This typically includes metadata about the uploaded image material, such as media IDs or URLs assigned by WeChat.
No binary data output is produced by this node.
Example output structure (simplified):
{
"media_id": "MEDIA_ID_STRING",
"url": "https://api.weixin.qq.com/..."
}
Dependencies
- Requires an active WeChat Official Account API credential with appropriate permissions.
- The node uses internal helper functions to make authenticated requests to WeChat's API endpoints.
- No additional external dependencies beyond the configured API credentials.
Troubleshooting
- Image size limit exceeded: The WeChat API restricts image uploads to files smaller than 1MB. Ensure your image meets this requirement.
- Unsupported image format: Only JPG and PNG formats are supported. Verify your image format before uploading.
- Invalid Base64 data: If using Base64 input, ensure the string is correctly encoded and complete.
- Network or authentication errors: Confirm that the API credentials are valid and have not expired.
- Error messages from WeChat API: These will be returned in the JSON output under an error field if
continueOnFailis enabled. Check the message for details like invalid token or quota limits.
Links and References
- WeChat Official Account API Documentation - Material Management
- WeChat Official Account API - Upload Image
This summary is based solely on static analysis of the provided source code and property definitions.