Green API icon

Green API

Send WhatsApp messages via Green API

Overview

This node enables sending a location message via WhatsApp using the Green API service. It is designed to share geographic locations with contacts or groups on WhatsApp by specifying latitude and longitude coordinates, optionally including a location name and address for better context.

Common scenarios where this node is beneficial include:

  • Sharing meeting points or event locations with friends or colleagues.
  • Sending delivery or pickup locations in customer support chats.
  • Broadcasting location-based information in group chats.

For example, you can send a location of a restaurant to a friend by providing its latitude, longitude, name, and address, allowing the recipient to view it directly in WhatsApp.

Properties

Name Meaning
Chat ID The identifier of the chat to send the location to. For private chats use phone@c.us, for groups use chatId@g.us.
Location Name Optional name of the location (e.g., "Restaurant").
Address Optional address details of the location (e.g., "123456, Perm").
Latitude Required latitude coordinate of the location (decimal number).
Longitude Required longitude coordinate of the location (decimal number).
Quoted Message ID Optional ID of a message to quote in the reply (for referencing a previous message).

Output

The node outputs a JSON array containing the response from the Green API after attempting to send the location message. This response typically includes metadata about the sent message such as message ID, status, and timestamps.

No binary data output is produced by this operation.

Dependencies

  • Requires an active Green API account with valid credentials: an instance ID and an API token.
  • The node makes HTTP POST requests to the Green API endpoints to perform actions.
  • Proper configuration of these credentials within n8n is necessary for authentication.
  • Internet connectivity is required to reach the Green API service.

Troubleshooting

  • Failed to send location: This error may occur if the API credentials are invalid, the chat ID is incorrect, or the latitude/longitude values are out of range. Verify all input parameters and credentials.
  • Network errors: Ensure that your environment has internet access and that the Green API service is reachable.
  • Invalid chat ID format: Use the correct format for chat IDs (phone@c.us for private chats, chatId@g.us for groups).
  • Missing required fields: Latitude and longitude must be provided; otherwise, the request will fail.
  • If quoting a message, ensure the quoted message ID exists in the chat.

Links and References

Discussion