Zalo icon

Zalo

Zalo Node

Overview

This node operation "Add User To Group" under the "API" resource is designed to add one or more users to a specified group via an API call. It supports sending messages in two formats: either as raw JSON or as a predefined message format. This functionality is useful in scenarios where you need to programmatically manage group memberships, such as adding participants to chat groups, project teams, or mailing lists.

Practical examples:

  • Automatically adding new employees to a company communication group.
  • Adding customers to a promotional group after they sign up.
  • Managing user access by grouping users dynamically based on roles or events.

Properties

Name Meaning
Send Option Choice of message format to send when adding users:
- Raw Json: Send message in JSON format.
- Message: Send message in a predefined format.
Group ID The unique identifier of the group to which users will be added.
User IDs Comma-separated list of user IDs to add to the group.

Output

The node outputs JSON data representing the result of the add-user-to-group API call. This typically includes confirmation of success, details about the users added, and any relevant metadata returned by the API.

If the node supports binary data output (not explicitly shown in the provided code), it would represent related files or media associated with the operation, but this is not indicated here.

Dependencies

  • Requires access to an external API that manages groups and users.
  • Needs appropriate API authentication credentials configured in n8n (e.g., an API key or token).
  • The node depends on internal modules for making HTTP requests and handling responses, as suggested by imported dependencies (though obfuscated).

Troubleshooting

  • Common issues:

    • Invalid or missing Group ID or User IDs can cause the API call to fail.
    • Incorrect API credentials or insufficient permissions may lead to authorization errors.
    • Improperly formatted User IDs (e.g., missing commas) might cause parsing errors.
  • Error messages:

    • Errors related to authentication usually indicate invalid or missing API keys; verify credential setup.
    • Validation errors often point to missing required fields like Group ID or User IDs.
    • Network or timeout errors suggest connectivity issues with the external API.
  • Resolution tips:

    • Double-check all required input properties are correctly set.
    • Ensure API credentials are valid and have necessary permissions.
    • Validate the format of User IDs string.
    • Review API documentation for specific error codes and messages.

Links and References

  • Refer to the external API's official documentation for detailed information on the "add user to group" endpoint.
  • n8n documentation on creating and configuring custom nodes: https://docs.n8n.io/integrations/creating-nodes/
  • General best practices for API authentication and error handling in n8n workflows.

Note: The source code was heavily obfuscated, so the summary is based on static analysis of the provided property definitions and typical patterns for such operations.

Discussion