MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Overview

This node operation sends a location message to a specified WhatsApp contact using the MegaAPI WhatsApp service. It allows users to share geographic coordinates along with an optional address description and caption. This is useful in scenarios such as:

  • Sharing meeting points or event locations with contacts.
  • Sending delivery or pickup addresses directly via WhatsApp.
  • Providing directions or place references during conversations.

For example, you can send a location of a restaurant with its latitude and longitude, accompanied by a caption like "Meet me here" to a friend’s WhatsApp number.

Properties

Name Meaning
To (Contact) The WhatsApp contact to send the location to. Format: phone_number@s.whatsapp.net (e.g., 551199999999@s.whatsapp.net).
Address The address or location description that will accompany the location message.
Latitude The latitude coordinate of the location. Can be in decimal format (e.g., -15.7470795) or integer format (e.g., 157470795).
Longitude The longitude coordinate of the location. Can be in decimal format (e.g., -48.2982315) or integer format (e.g., 482982315).
Caption Optional text caption to accompany the location message, providing additional context or information.
Information Informational notice explaining that the node sends a location message to the specified WhatsApp contact, supporting decimal or integer coordinates.

Output

The node outputs JSON data representing the result of the location message sending operation. Typically, this includes confirmation details such as message IDs or status indicators returned from the MegaAPI WhatsApp service.

If the operation fails for any item, the output may include an error object with the error message.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the MegaAPI WhatsApp service.
  • Needs an API authentication token and host URL configured in the node credentials.
  • The node uses HTTP requests with bearer token authorization to communicate with the MegaAPI backend.

Troubleshooting

  • Invalid Contact Format: Ensure the "To (Contact)" property follows the required format phone_number@s.whatsapp.net. Missing or malformed contact strings will cause errors.
  • Coordinate Format Issues: Latitude and longitude must be valid numbers. Mixing formats or invalid values may lead to failed message sending.
  • Authentication Errors: If the API token or host is incorrect or expired, the node will fail to send messages. Verify credential configuration.
  • Network Issues: Connectivity problems with the MegaAPI service will prevent message delivery.
  • Error Messages: The node throws errors indicating unknown operations or resources if misconfigured. For example, selecting an unsupported operation under the "message" resource will raise an error.

To resolve issues, verify all input properties, check credentials, and ensure network connectivity.

Links and References

Discussion