Zalo User

Send messages and interact with Zalo User API

Send Message

AI-generated

Overview

This node integrates with the Zalo User API to send messages and interact with a user's Zalo account. It supports sending text messages, images, files, replying to specific messages, retrieving user profiles, and fetching conversation lists. This node is useful for automating communication workflows on the Zalo platform, such as customer support messaging, broadcasting updates, or managing conversations programmatically.

Practical examples:

  • Sending a personalized greeting message to a user.
  • Sending an image or file attachment to a recipient.
  • Replying to a specific message in a conversation thread.
  • Fetching profile information of a user or the authenticated account.
  • Retrieving a list of recent conversations for monitoring or analytics.

Properties

Name Meaning
Recipient The display name or User ID of the message recipient.
Message The text content of the message to send (used only in "Send Message" operation).

Note: These properties are relevant for the Send Message operation under the Default resource.

Output

The node outputs JSON objects containing the result of the performed operation. For the Send Message operation, the output JSON includes:

  • success: Boolean indicating if the operation was successful.
  • operation: The operation performed, e.g., "sendMessage".
  • recipient: The recipient's identifier used.
  • message: The sent message content.
  • result: The raw response from the Zalo API for the send message request.
  • timestamp: ISO string timestamp of when the operation was executed.

If an error occurs and the node is set to continue on failure, the output JSON will contain:

  • success: false
  • error: Error message describing what went wrong.
  • operation: The attempted operation.
  • timestamp: Timestamp of the failure.

The node can also output binary data for other operations like sending images or files, but for the Send Message operation, the output is purely JSON.

Dependencies

  • Requires an API key credential configured with session authentication data including cookies and user agent strings.
  • Uses the external zca-js library to interact with the Zalo User API.
  • The node expects valid session credentials to authenticate requests; these must be generated and maintained outside the node.

Troubleshooting

  • Failed to login with saved session. Please generate new QR code.
    This error indicates that the stored session cookie is invalid or expired. To resolve, regenerate the session by scanning a new QR code via the authentication process.

  • Invalid credentials. Please use "Session Data" authentication method.
    The node requires session-based authentication credentials. Ensure you provide the correct session cookie and user agent details.

  • Failed to connect to Zalo. Please check your credentials.
    Indicates inability to establish a connection with the Zalo API, likely due to incorrect or expired credentials.

  • Unknown operation: [operation]
    The specified operation is not supported. Verify the operation name matches one of the allowed options.

Common issues often stem from expired sessions or misconfigured credentials. Always ensure the session data is current and correctly input.

Links and References

Discussion