Wechat Official Account Node icon

Wechat Official Account Node

Wechat Official Account Node

Overview

This node integrates with the Wechat Official Account platform to retrieve user information. Specifically, for the "用户" (User) resource and the "获取用户信息" (Get User Info) operation, it fetches details about a specific user identified by their OpenID within the current official account context.

Common scenarios where this node is useful include:

  • Personalizing messages or content based on user profile data.
  • Managing user data synchronization between Wechat and other systems.
  • Building customer support workflows that require fetching user details dynamically.

For example, you might use this node to get a user's language preference and display customized content accordingly.

Properties

Name Meaning
OpenID The unique identifier of the ordinary user within the current official account. Required to specify which user's info to retrieve.
语言 (Language) The language version for the returned user information. Options: zh_CN (Simplified Chinese), zh_TW (Traditional Chinese), en (English). Defaults to zh_CN.

Output

The node outputs JSON data containing the requested user's information as returned by the Wechat Official Account API. This typically includes fields such as nickname, gender, location, language, subscription status, and other profile details.

If the node supports binary data output, it would generally relate to user avatar images or media associated with the user profile, but this is not explicitly shown in the provided code.

Dependencies

  • Requires an API key credential for authenticating with the Wechat Official Account platform.
  • The node depends on internal resource and operation modules dynamically loaded from the resource/*.js files, which implement the actual API calls.
  • No additional external services are indicated beyond the Wechat Official Account API.

Troubleshooting

  • Common issues:

    • Invalid or missing OpenID parameter will cause the API call to fail.
    • Incorrect or expired API credentials can lead to authentication errors.
    • Network connectivity problems may prevent successful API requests.
  • Error messages:

    • "未实现方法: 用户.获取用户信息" ("Unimplemented method: user.getUserInfo") indicates the requested resource-operation pair is not implemented or incorrectly specified.
    • Errors thrown during the API call are logged with detailed messages and stack traces.
    • If "Continue On Fail" is disabled, any error will stop execution; enabling it allows processing subsequent items despite failures.

To resolve errors:

  • Verify the OpenID value is correct and corresponds to a subscribed user.
  • Ensure valid API credentials are configured in n8n.
  • Check network access to the Wechat API endpoints.

Links and References

Discussion