Zalo User

Send messages and interact with Zalo User API

Get Profile

AI-generated

Overview

This node integrates with the Zalo User API, enabling users to interact with Zalo messaging and user profile features. It supports sending messages (text, images, files), replying to messages, retrieving user profiles, and fetching conversation lists.

A common use case is automating communication workflows on the Zalo platform, such as sending notifications, customer support replies, or gathering user information programmatically.

For example, you can:

  • Send a text message to a specific user.
  • Retrieve the profile details of a user by their User ID or get your own profile.
  • Reply to a particular message in a conversation.
  • Fetch a list of recent conversations.

The "Get Profile" operation specifically allows fetching detailed profile information for a given User ID or the authenticated user's own profile if no User ID is provided.

Properties

Name Meaning
User ID The User ID to fetch the profile for. Leave empty to retrieve the profile of yourself.

Output

The output JSON object for the "Get Profile" operation contains:

  • success: Boolean indicating if the operation was successful.
  • operation: The string "getProfile".
  • userId: The User ID queried, or "self" if fetching own profile.
  • profile: An object containing the user's profile information as returned by the Zalo API.
  • timestamp: ISO 8601 timestamp of when the operation was performed.

Example output structure:

{
  "success": true,
  "operation": "getProfile",
  "userId": "123456789",
  "profile": {
    // user profile fields from Zalo API
  },
  "timestamp": "2024-06-01T12:00:00.000Z"
}

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential configured with session authentication data including a valid cookie and user agent string.
  • Uses the external zca-js library to interact with the Zalo API.
  • The node expects the session cookie to be valid; otherwise, it will prompt for re-authentication via QR code generation.

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 in the credential setup.

  • Invalid credentials. Please use "Session Data" authentication method.
    The node requires session-based authentication. Ensure that the credentials are set up correctly with the necessary session cookie and user agent.

  • Failed to connect to Zalo. Please check your credentials.
    Indicates a failure to establish connection using provided credentials. Verify that the session data is correct and active.

  • Unknown operation: [operation]
    This means an unsupported operation was requested. Confirm that the operation name matches 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