Zalo User

Send messages and interact with Zalo User API

Send Image

AI-generated

Overview

This node enables interaction with the Zalo User API, primarily to send messages, images, files, reply to messages, and retrieve user profiles or conversations on the Zalo platform. It is useful for automating communication tasks such as sending notifications, sharing media content, replying to user inquiries, or fetching user data within workflows.

A practical example includes automatically sending an image to a specified recipient when a certain event occurs, like sending a promotional banner to customers or sharing a photo in response to a trigger.

Properties

Name Meaning
Recipient The display name or User ID of the message recipient.
Image Base64 encoded image data or a URL pointing to the image to be sent.

Output

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

  • success: Boolean indicating if the operation was successful.
  • operation: The string "sendImage".
  • recipient: The recipient identifier used.
  • result: The raw response from the Zalo API after sending the image.
  • timestamp: ISO string timestamp of when the operation was executed.

No binary data output is produced by this operation.

Example output JSON:

{
  "success": true,
  "operation": "sendImage",
  "recipient": "user123",
  "result": { /* API response object */ },
  "timestamp": "2024-06-01T12:00:00.000Z"
}

Dependencies

  • Requires an API key credential configured for authenticating with the Zalo User API using session data (cookie-based authentication).
  • The node depends on the external zca-js library to interact with the Zalo API.
  • Proper session cookies and user agent strings must be provided in credentials to establish a connection.

Troubleshooting

  • Failed to login with saved session: This error indicates that the stored session cookie is invalid or expired. To resolve, generate a new QR code to refresh the session.
  • Invalid credentials: Occurs if the authentication method is not set to use session data or if required credential fields are missing. Ensure credentials are correctly configured with valid session cookies.
  • Failed to connect to Zalo: Indicates connection issues or invalid credentials. Verify network connectivity and credential correctness.
  • Unknown operation: Happens if an unsupported operation value is passed. Confirm the operation parameter is one of the supported options.
  • If the node is set to continue on fail, errors will be returned in the output JSON with success: false and an error message field.

Links and References

Discussion