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 the conversation history of a specific user. It is useful for scenarios where you want to analyze or process past chat messages between your OA and a user, such as customer support follow-ups, chat analytics, or automated message processing.

For example, you can use this node to fetch the last 10 messages starting from a certain 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 point).
Số Lượng The number of messages to retrieve, with a maximum limit of 50 messages per request.

Output

The output is a JSON object containing the conversation history data returned by the Zalo OA API. This typically includes an array of messages with details such as message content, timestamps, sender information, and possibly metadata related to each message.

No binary data output is produced by this operation.

Dependencies

  • Requires a valid API access token credential for the Zalo Official Account.
  • The node uses the Zalo OA API endpoint https://openapi.zalo.me/v3.0/oa/conversation to fetch conversation data.
  • Proper permissions must be granted to the API token, specifically the permission to manage and read user messages.
  • The node expects the environment or workflow static data to provide valid tokens or falls back to credentials configured in n8n.

Troubleshooting

  • Common Issues:

    • Invalid or expired access token: Ensure that the API key or token used has not expired and has the necessary permissions.
    • Incorrect User ID: Verify that the User ID provided corresponds to a valid user who has interacted with the OA.
    • Offset or count parameters out of range: The count should not exceed 50; offset should be a non-negative integer.
  • Error Messages:

    • Errors related to API calls will include messages indicating failure to fetch conversation history, often accompanied by HTTP status codes.
    • If the node returns an error with a suggestion to check permissions or tokens, verify that the OA access token is valid and has the required scopes.
    • Network or connectivity errors may occur if the Zalo API endpoint is unreachable.
  • Resolution Steps:

    • Refresh or reconfigure the API authentication token.
    • Double-check input parameters for correctness.
    • Consult Zalo OA API documentation for any changes or updates to endpoints or required permissions.

Links and References

Discussion