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 perform various operations related to messaging, user management, content publishing, and store management on the Zalo platform. Specifically, the "Kiểm Tra Trạng Thái Tin Nhắn" (Check Message Status) operation allows users to check the delivery and read status of a specific message sent via Zalo OA.

Common scenarios for this node include:

  • Verifying if a sent message has been delivered or read by the recipient.
  • Managing followers and tags within a Zalo OA.
  • Uploading media files such as images, GIFs, and documents.
  • Creating and managing articles and products in the Zalo OA store.
  • Retrieving conversation histories and recent chats.

Practical example:

  • After sending a message to a user, you can use the "Kiểm Tra Trạng Thái Tin Nhắn" operation to confirm whether the message was successfully delivered or read, helping automate follow-up actions based on message status.

Properties

Name Meaning
Message ID The unique identifier of the message whose status you want to check.

Output

The output is a JSON object containing the response from the Zalo OA API regarding the message status. It typically includes fields indicating whether the message was delivered, read, or encountered any errors.

Example structure (simplified):

{
  "message_id": "string",
  "status": "delivered|read|failed",
  "error": false,
  "error_message": null
}

If an error occurs during the API call, the output JSON will contain:

  • error: true
  • message: description of the error
  • response: detailed API error response data (if available)
  • note and suggestion: guidance on resolving common issues

The node does not output binary data for this operation.

Dependencies

  • Requires an API authentication token (access token) for the Zalo Official Account API.
  • Uses the Zalo OA API endpoint at https://openapi.zalo.me/v3.0/oa/message/status.
  • Requires proper OAuth credentials configured in n8n to authenticate requests.
  • Depends on the axios HTTP client library for making API calls.

Troubleshooting

  • Common Issues:

    • Invalid or expired access token leading to authentication failures.
    • Incorrect or non-existent message ID causing API errors.
    • Insufficient permissions granted to the access token, especially missing "Manage message information" rights.
    • Network connectivity problems or API endpoint changes.
  • Error Messages and Resolutions:

    • "Lỗi khi gọi API kiểm tra trạng thái tin nhắn: <error message>": Indicates failure calling the message status API. Check the validity of the message ID and access token.
    • API response status codes like 401 Unauthorized suggest invalid credentials; refresh or reconfigure the API key.
    • If the API notes that the method changed from GET to POST or endpoint updated, ensure the node uses the latest API version and method.
    • "Zalo đã thay đổi API getmessagestatus sang API message/status trong v3.0 và yêu cầu sử dụng phương thức POST thay vì GET.": Make sure the node uses POST requests to the correct endpoint as per the latest API documentation.

Links and References


This summary focuses exclusively on the "Kiểm Tra Trạng Thái Tin Nhắn" operation under the Zalo OA resource, as requested.

Discussion