Actions36
- Zalo OA Actions
- Gửi Tin Nhắn Văn Bản
- Gửi Tin Nhắn Hình Ảnh
- Gửi Tin Nhắn File
- Gửi Tin Nhắn Danh Sách
- Lấy Thông Tin Người Theo Dõi
- Lấy Danh Sách Người Theo Dõi
- Cập Nhật Thông Tin Người Theo Dõi
- Lấy Danh Sách Cuộc Trò Chuyện Gần Đây
- Lấy Lịch Sử Hội Thoại
- Kiểm Tra Trạng Thái Tin Nhắn
- Upload Hình Ảnh
- Upload Hình Ảnh GIF
- Upload File
- Lấy Danh Sách Tag
- Gán Tag Cho Người Theo Dõi
- Xóa Tag
- Xóa Người Theo Dõi Khỏi Tag
- Cập Nhật Menu OA
- Tạo Bài Viết
- Cập Nhật Bài Viết
- Xóa Bài Viết
- Lấy Danh Sách Bài Viết
- Lấy Chi Tiết Bài Viết
- Chuẩn Bị Upload Video
- Xác Thực Video
- Tạo Sản Phẩm
- Cập Nhật Sản Phẩm
- Lấy Thông Tin Sản Phẩm
- Lấy Danh Sách Sản Phẩm
- Tạo Danh Mục
- Cập Nhật Danh Mục
- Lấy Danh Sách Danh Mục
- Tạo Đơn Hàng
- Cập Nhật Đơn Hàng
- Lấy Thông Tin Đơn Hàng
- Lấy Danh Sách Đơn Hàng
Overview
This node interacts with the Zalo Official Account (OA) API, enabling automation and management of various Zalo OA features. Specifically, the "Lấy Lịch Sử Hội Thoại" (Get Conversation History) operation retrieves the chat history between the OA and a specified user.
Use cases for this operation include:
- Fetching recent messages exchanged with a particular user for customer support or analytics.
- Archiving conversation history for compliance or record-keeping.
- Triggering workflows based on past interactions or message content.
Example: Retrieve the last 10 messages starting from the 0th position in the conversation with a user identified by their User ID.
Properties
| Name | Meaning |
|---|---|
| User ID | The unique identifier of the user whose conversation history you want to retrieve. |
| Vị Trí Bắt Đầu | The offset position to start fetching messages from within the conversation (starting index). |
| Số Lượng | The number of messages to retrieve (maximum 50). |
Output
The output is a JSON object containing the response from the Zalo OA API's conversation endpoint. It includes details about the messages retrieved such as message content, timestamps, sender information, and other metadata related to the conversation history.
If an error occurs during the API call, the output JSON will contain an error flag set to true, an error message, optional note and suggestion fields to help diagnose the issue, and possibly the raw API response data.
No binary data output is produced by this operation.
Dependencies
- Requires an active Zalo Official Account API access token credential configured in n8n.
- Uses the Zalo OA API endpoint at
https://openapi.zalo.me/v2.0/oa/conversation. - The node depends on the
axiosHTTP client library for making API requests. - Proper permissions must be granted to the access token, specifically the permission to manage and read messages ("Quyền quản lý tin nhắn người quan tâm").
Troubleshooting
Common Issues
- Invalid or expired access token: The API call will fail if the access token is missing, invalid, or expired.
- Insufficient permissions: If the access token lacks the required message management permission, the API will return an authorization error.
- Incorrect User ID: Providing an incorrect or non-existent user ID will result in an error or empty conversation data.
- Offset/count out of range: Requesting an offset or count beyond available messages may return fewer results or errors.
Error Messages and Resolutions
"Lỗi khi gọi API lấy lịch sử hội thoại: <error message>": Indicates failure in calling the conversation API. Check network connectivity, access token validity, and API permissions."Hãy đảm bảo rằng bạn đã cấp quyền "Quyền quản lý tin nhắn người quan tâm" cho ứng dụng và có access_token hợp lệ.": Suggests missing required permissions or invalid token. Reauthorize the app and verify token scopes.- Network or timeout errors: Ensure stable internet connection and that the Zalo API service is reachable.