WeChat Enhanced icon

WeChat Enhanced

WeChat Enhanced Node - Suporte completo para Mini Programs, Official Accounts, WeChat Pay e WeChat Work

Overview

The "WeChat Enhanced" node provides comprehensive integration with various WeChat services, including Mini Programs, Official Accounts, WeChat Pay, and WeChat Work. Specifically, for the Mini Program resource and the Upload Media operation, this node allows users to upload media files (such as images, voice, video, thumbnails, or generic files) to the WeChat Mini Program platform.

This operation is beneficial when you need to programmatically manage media assets within a Mini Program, such as uploading images for use in content, videos for promotional materials, or other file types required by your Mini Program's functionality.

Practical example:
You have a Mini Program that displays user-uploaded photos. Using this node, you can automate the process of uploading these photos directly to the WeChat server, ensuring they are properly stored and accessible within the Mini Program environment.

Properties

Name Meaning
Media Type The type of media being uploaded. Options: Image, Voice, Video, Thumb, File
Media The media file data encoded in base64 format. This is the actual content of the file to upload

Output

The output JSON contains the response from the WeChat API after uploading the media. Typically, this includes metadata about the uploaded media such as its media ID, type, and possibly URLs or other identifiers needed to reference the media later in the Mini Program.

If the node supports binary data output for media retrieval operations, it would be summarized accordingly; however, for the Upload Media operation, the output is JSON metadata confirming the upload success and details.

Dependencies

  • Requires an active subscription and valid API key credential for the external "N8N Tools API" service, which acts as a proxy or helper for WeChat API calls.
  • Requires credentials for authenticating with WeChat services (e.g., OAuth2 tokens or API keys), configured in n8n.
  • The node internally uses a helper library (wechat-api) to interact with WeChat endpoints.
  • The media content must be provided as a base64-encoded string.

Troubleshooting

  • Invalid subscription or API key error:
    If the node throws an error indicating invalid subscription or API key, verify that the API key credential for the external N8N Tools API is correctly set up and active.

  • Unsupported operation error:
    If the operation name is incorrect or not supported for the Mini Program resource, the node will throw an error. Ensure the operation is exactly "uploadMedia" for this use case.

  • Base64 encoding issues:
    The media property must be a valid base64-encoded string. Invalid encoding will cause the upload to fail. Use proper encoding tools or methods to convert files before passing them to the node.

  • API rate limits or network errors:
    Network issues or WeChat API rate limits may cause failures. Implement retry logic or check WeChat API usage quotas if uploads fail intermittently.

Links and References

Discussion