Zalo User

Send messages and interact with Zalo User API

Send File

AI-generated

Overview

This node enables interaction with the Zalo User API to send messages, images, files, reply to messages, and retrieve user profile or conversation information. It is useful for automating communication tasks on the Zalo platform, such as sending notifications, sharing media files, or managing conversations programmatically.

A practical example is sending a file attachment to a specific Zalo user by providing their display name or User ID along with the file data. Another use case is retrieving the profile information of a user or the authenticated account itself.

Properties

Name Meaning
Recipient The display name or User ID of the message recipient.
File Base64 encoded file data or a file path to the file to be sent.
File Name The name of the file when sending base64 encoded data (optional if sending via file path).

Output

The output JSON object contains the result of the "Send File" operation with the following structure:

  • success: Boolean indicating if the operation was successful.
  • operation: The string "sendFile" indicating the performed operation.
  • recipient: The recipient's display name or User ID.
  • fileName: The name of the sent file.
  • result: The raw response from the Zalo API for the file sending action.
  • timestamp: ISO string timestamp of when the operation was executed.

No binary data is outputted by this node; it only returns metadata and API response details in JSON format.

Dependencies

  • Requires an API key credential configured with session-based authentication including a valid cookie and user agent string.
  • Uses the external zca-js library to interact with the Zalo User API.
  • The node expects the session cookie to be valid and able to authenticate requests.

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 obtain fresh session credentials.
  • Invalid credentials: Occurs if the authentication method is not set to session data or required fields are missing. Ensure correct credential configuration.
  • Unknown operation: Happens if an unsupported operation value is provided. Verify the operation parameter is one of the supported options.
  • Failed to connect to Zalo: Could indicate network issues or invalid credentials. Check internet connectivity and credential validity.
  • If the node is set to continue on fail, errors will be returned in the output JSON with success: false and an error message.

Links and References

Discussion