WSAPI icon

WSAPI

Interact with WSAPI WhatsApp API

Overview

The node integrates with the WSAPI WhatsApp API to send a geographic location message via WhatsApp. It allows users to specify latitude and longitude coordinates, optionally include a human-readable address, and send this location to a specific WhatsApp contact or group.

This node is useful in scenarios such as:

  • Sharing meeting points or event locations with contacts or groups.
  • Sending real-time location updates in customer support chats.
  • Broadcasting location-based information in group chats.

For example, a delivery service could use this node to send the current location of a driver to a customer, or an event organizer could share the venue location with attendees.

Properties

Name Meaning
To The WhatsApp ID of the recipient. For individual contacts, this is the phone number with country code (no plus sign) followed by @s.whatsapp.net (e.g., 1234567890@s.whatsapp.net). For groups, it is the group ID followed by @g.us.
Latitude Geographic latitude coordinate of the location to send. Must be a decimal degree between -90 and 90 (e.g., 40.7128).
Longitude Geographic longitude coordinate of the location to send. Must be a decimal degree between -180 and 180 (e.g., -74.0060).
Address Optional descriptive address or place name to help identify the location (e.g., "Times Square, New York, NY").

Advanced Options

Name Meaning
Mentions Comma-separated list of phone numbers (without @) to mention in the message.
Reply To Message ID ID of an existing message to which this location message will reply.
Is Forwarded Boolean flag indicating if the message should be marked as forwarded.
View Once Boolean flag indicating if the message should disappear after being viewed. Only applicable for media messages like images or videos (not relevant for location).

Output

The node outputs JSON data representing the result of the send location operation. This typically includes metadata about the sent message such as message ID, status, timestamps, and recipient details.

If the operation involves binary data (not typical for sending location), the node would handle it accordingly, but for sending location, output is purely JSON.

Dependencies

  • Requires an active connection to the WSAPI WhatsApp API.
  • Needs an API key credential configured in n8n to authenticate requests.
  • The base URL for the WSAPI must be set in the credentials.
  • No additional external dependencies are required beyond the WSAPI service.

Troubleshooting

  • Invalid Recipient ID: If the "To" property is incorrectly formatted (missing country code, wrong suffix), the API may reject the request. Ensure the format matches phone_number@s.whatsapp.net for contacts or group_id@g.us for groups.
  • Latitude/Longitude Out of Range: Coordinates outside valid ranges (-90 to 90 for latitude, -180 to 180 for longitude) will cause errors. Validate input before sending.
  • Missing Required Fields: The node requires "To", "Latitude", and "Longitude". Omitting these will cause validation errors.
  • API Authentication Errors: If the API key or base URL is incorrect or missing, authentication will fail. Verify credential configuration.
  • Reply To Message ID Not Found: If specifying a reply message ID that does not exist or is invalid, the API may return an error.
  • Forwarded or View Once Flags Misuse: Setting "View Once" on a location message has no effect and might cause unexpected behavior; it is intended for media messages only.

Links and References

Discussion