WeChat Official Account icon

WeChat Official Account

微信公众号API操作

Actions4

Draft → Add

AI-generated

Overview

This node integrates with the WeChat Official Account API to manage draft articles. Specifically, the Draft - Add operation allows users to create new draft articles composed of one or more rich media articles (each containing text, images, and metadata). This is useful for content creators and marketers who want to prepare and save WeChat articles before publishing them.

Typical use cases include:

  • Preparing multiple articles as drafts for review or scheduling.
  • Creating rich content with HTML support and cover images.
  • Managing article metadata such as author, digest, and source URLs.

Example: A marketing team can batch upload several articles with titles, cover images, and content in HTML format, saving them as drafts to be published later.

Properties

Name Meaning
Articles A collection of one or more articles to add as a draft. Each article includes:
  Author The author of the article (string).
  Content The main content of the article, supporting HTML tags (required).
  Content Source URL The original URL of the article, linked when clicking "Read Original".
  Digest A summary or abstract of the article.
  Show Cover Pic Boolean indicating whether to show the cover picture (true = show, false = hide).
  Thumb Media ID The permanent media ID of the cover image (required).
  Title The title of the article (required).

Output

The node outputs JSON data representing the response from the WeChat API after adding the draft. This typically includes information about the created draft, such as its media ID or any error messages if the operation failed.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authenticating with the WeChat Official Account API.
  • The node depends on internal helper functions to make HTTP requests to WeChat endpoints.
  • Proper configuration of credentials in n8n is necessary to authorize API calls.

Troubleshooting

  • Common issues:

    • Missing required fields like content, title, or thumb_media_id will cause errors.
    • Invalid or expired API credentials will result in authentication failures.
    • Providing non-permanent media IDs for cover images will cause the API to reject the request.
  • Error messages:

    • Errors returned from the WeChat API are passed through in the JSON output under an error field if the node is set to continue on failure.
    • Authentication errors usually indicate invalid or missing API keys.
    • Validation errors often specify which required property is missing or malformed.
  • Resolutions:

    • Ensure all required properties are filled correctly.
    • Verify that the cover image media ID is permanent.
    • Check and refresh API credentials if authentication fails.

Links and References

Discussion