Zalo OA icon

Zalo OA

Tương tác với Zalo Official Account API

Overview

This node interacts with the Zalo Official Account (OA) API to retrieve detailed information about a specific follower of the OA. It is useful in scenarios where you want to fetch user profile data such as name, phone number, email, and other shared information for a given follower identified by their User ID.

Practical examples include:

  • Personalizing messages or campaigns based on follower details.
  • Synchronizing follower data with your CRM or database.
  • Analyzing follower demographics or engagement.

The node sends a request to the Zalo OA API endpoint /user/detail (version 3.0) with the specified User ID and returns the follower's information.

Properties

Name Meaning
User ID The unique identifier of the follower whose information you want to retrieve.

Output

The output is a JSON object containing the follower's detailed information as returned by the Zalo OA API. This typically includes fields such as:

  • user_id: The follower's user ID.
  • name: The follower's name.
  • phone: Phone number if shared.
  • email: Email address if shared.
  • Other shared profile information available via the API.

If an error occurs during the API call, the output JSON will contain an error flag set to true, along with a descriptive message, a note explaining possible causes, and a suggestion for troubleshooting.

The node does not output binary data for this operation.

Dependencies

  • Requires a valid API authentication token (access token) for the Zalo Official Account API.
  • The access token must have the necessary permissions to read follower information.
  • The node uses the Zalo OA API v3.0 endpoint: https://openapi.zalo.me/v3.0/oa/user/detail.
  • Proper configuration of credentials in n8n is required to provide the access token.

Troubleshooting

Common Issues

  • Invalid or expired access token: The API call will fail if the access token is invalid or expired.
  • Insufficient permissions: The access token must have the permission to manage user information.
  • Incorrect User ID: Providing a wrong or non-existent User ID will result in an error.
  • API changes: The Zalo OA API may change endpoints or required parameters; ensure you are using the latest API version.

Common Error Messages

  • "Error when calling user/detail API v3.0: <error message>"
    Indicates a failure in the API call. Check the access token validity and permissions.

  • "Please check the user_id and OA access permissions. API v3 requires different data format than v2."
    Suggests that the User ID or permissions might be incorrect or outdated.

How to Resolve

  • Verify that the access token is current and has the correct scopes.
  • Confirm the User ID exists and is correctly formatted.
  • Ensure the Zalo OA app has granted the necessary permissions.
  • Consult the latest Zalo OA API documentation for any updates.

Links and References

Discussion