Green API icon

Green API

Send WhatsApp messages via Green API or trigger workflows on webhooks

Overview

The "Get Group Data" operation of the Green API node allows users to retrieve detailed information about a specific WhatsApp group by providing its Group ID. This operation is part of the broader Green API integration for WhatsApp, which enables sending messages, managing groups, and handling chats programmatically.

This node is beneficial in scenarios where you need to:

  • Fetch metadata or current state of a WhatsApp group.
  • Automate workflows that depend on group details, such as monitoring group membership or settings.
  • Integrate WhatsApp group data into other systems like CRMs or databases.

Practical example:
You want to automatically log group information whenever a new message arrives in a group or periodically check group details to update your internal records. Using this operation, you can fetch the group's name, participants, admins, and other relevant data.

Properties

Name Meaning
Mode Select between "Action" (execute WhatsApp actions) or "Listen for Incoming Webhook" (trigger workflows on webhooks). For this operation, use "Action".
Resource The type of entity to operate on; here it should be set to "Group".
Operation The action to perform on the resource; for this summary, "Get Group Data".
Group ID The unique identifier of the WhatsApp group to retrieve information from. Example format: 972501234567-1587570015@g.us. This is required.

Output

The output is a JSON array containing the response from the Green API endpoint for getting group data. The structure typically includes:

  • Group metadata such as group name, description, creation date.
  • List of participants with their roles (e.g., admin or member).
  • Other group-specific details returned by the Green API.

The exact fields depend on the Green API's response but generally provide comprehensive information about the specified group.

No binary data output is involved in this operation.

Dependencies

  • Requires an active Green API account with valid credentials including an instance ID and an API token.
  • The node uses HTTP POST requests to the Green API endpoints.
  • Proper configuration of the Green API credentials in n8n is necessary.
  • Network access to https://api.green-api.com must be available.

Troubleshooting

  • Common issues:
    • Invalid or missing Group ID will cause the request to fail.
    • Incorrect or expired API credentials will result in authentication errors.
    • Network connectivity problems may prevent reaching the Green API server.
  • Error messages:
    • "Failed to get group data: <error message>" indicates the API call failed. Check the Group ID and credentials.
    • Errors related to JSON parsing or unexpected responses suggest possible API changes or malformed requests.
  • Resolution tips:
    • Verify the Group ID format and existence.
    • Ensure the API credentials are correctly set and have not expired.
    • Test network connectivity to the Green API endpoint.
    • Review the Green API documentation for any updates on the endpoint.

Links and References

Discussion