Zalo OA icon

Zalo OA

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

Overview

This node integrates with the Zalo Official Account (OA) API, enabling users to interact programmatically with various features of a Zalo OA. Specifically, the operation "Lấy Danh Sách Cuộc Trò Chuyện Gần Đây" (Get Recent Chat List) retrieves a list of recent conversations from the Zalo OA.

Typical use cases include:

  • Monitoring recent chats for customer support or engagement.
  • Automating responses or analytics based on recent user interactions.
  • Integrating chat data into CRM or other business tools.

For example, a business could use this node to fetch the last 10 recent chats and then trigger workflows to analyze customer sentiment or follow up on inquiries.

Properties

Name Meaning
offset The starting position to retrieve the list of recent conversations (pagination start).
count The number of recent conversations to retrieve (maximum 50).

These properties allow control over pagination when fetching recent chat data.

Output

The output is a JSON object representing the response from the Zalo OA API endpoint for recent chats. It typically includes:

  • A list/array of recent chat objects, each containing details such as user IDs, message snippets, timestamps, etc.
  • Metadata about the request such as total counts or paging information.
  • In case of errors, an error object with fields like error, message, note, and suggestion explaining the issue.

No binary data is output by this operation.

Dependencies

  • Requires an API authentication token credential for Zalo OA API access.
  • Uses the Zalo OA API endpoint at https://openapi.zalo.me/v2.0/oa/listrecentchat.
  • The node uses the HTTP client library axios for making requests.
  • The node expects proper permissions granted to the API token, specifically the permission to manage and read recent messages ("Quyền quản lý tin nhắn người quan tâm").

Troubleshooting

Common Issues

  • Permission Denied: If the API token lacks the required permissions, the API call will fail.
  • Invalid Token: Expired or invalid tokens will cause authentication errors.
  • Rate Limits: Excessive requests may be throttled by the Zalo API.
  • Incorrect Parameters: Providing out-of-range values for count or negative offset can cause errors.

Error Messages and Resolutions

  • "Lỗi khi gọi API listrecentchat: <error message>": Indicates failure in calling the recent chat API. Check network connectivity, token validity, and permissions.
  • "Vui lòng kiểm tra lại cấu hình OA và quyền truy cập.": Suggests verifying the OA configuration and that the access token has the necessary rights.
  • Ensure the count parameter does not exceed 50; otherwise, the API may reject the request.
  • If encountering unexpected errors, verify that the Zalo OA API version and endpoints have not changed.

Links and References


This summary focuses exclusively on the "Lấy Danh Sách Cuộc Trò Chuyện Gần Đây" operation under the Zalo OA resource, as requested.

Discussion