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, specifically providing various operations to manage and communicate with followers, articles, products, categories, orders, and more within a Zalo OA. The selected operation "Lấy Thông Tin Người Theo Dõi" (Get Follower Information) retrieves detailed information about a specific follower of the Zalo OA by their user ID.

Typical use cases include:

  • Fetching profile details of a follower for personalized communication or CRM purposes.
  • Integrating follower data into workflows for marketing automation or customer support.
  • Verifying follower identity or status before sending messages or assigning tags.

Example: You want to get the name, avatar, gender, or other profile details of a follower who interacted with your Zalo OA chatbot to tailor responses or update your database.

Properties

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

Output

The output is a JSON object containing the response from the Zalo OA API endpoint /v3.0/oa/user/detail. This typically includes detailed information about the follower such as:

  • user_id: The follower's user ID.
  • name: The follower's display name.
  • avatar: URL to the follower's avatar image.
  • Other profile fields provided by Zalo OA like gender, birthday, location, etc.

If an error occurs (e.g., invalid user ID, insufficient permissions), the output JSON will contain an error flag set to true, an error message, and possibly additional notes or suggestions to resolve the issue.

The node does not output binary data for this operation.

Dependencies

  • Requires an API authentication token (access token) for the Zalo Official Account API.
  • The access token must have appropriate permissions, especially the permission to manage and read follower information.
  • Uses the Zalo OA API base URL: https://openapi.zalo.me/v3.0/oa.
  • The node depends on the axios HTTP client library for making API requests.

Troubleshooting

Common Issues

  • Invalid or expired access token: The API call will fail if the token is missing, expired, or lacks required permissions.
  • Incorrect user ID: If the provided user ID does not correspond to a follower of the OA, the API will return an error.
  • Insufficient permissions: The OA app must have granted the "Manage user info" permission to allow fetching follower details.

Error Messages and Resolutions

  • "Lỗi khi gọi API lấy thông tin người dùng: ..."
    Means there was an error calling the user detail API. Check that the user ID is correct and the access token has the necessary permissions.
  • Note in error message:
    "Zalo đã thay đổi API getprofile sang API user/detail trong v3.0. Vui lòng kiểm tra lại cấu hình OA và quyền truy cập."
    Indicates the API endpoint changed in version 3.0; ensure your OA configuration and permissions are updated accordingly.
  • Suggestions often recommend verifying the access token validity and ensuring the OA app has the right scopes enabled.

Links and References

Discussion