Green API icon

Green API

Send WhatsApp messages via Green API

Message → Send Contact

AI-generated

Overview

This node operation sends a contact message via WhatsApp using the Green API. It allows users to specify the chat ID to send the contact to, the phone number of the contact in international format, and optional details such as first name, middle name, last name, and company name. It also supports quoting a previous message in the chat. This operation is useful for automating the sharing of contact information in WhatsApp conversations, for example, sending a business contact or a personal contact to a chat or group.

Use Case Examples

  1. Sending a contact card with phone number and name to a WhatsApp chat.
  2. Sharing a business contact with company name included in a group chat.
  3. Quoting a previous message while sending a contact to provide context.

Properties

Name Meaning
Chat ID The WhatsApp chat ID where the contact message will be sent. For private chats, use phone@c.us format; for group chats, use chatId@g.us.
Phone Contact The phone number of the contact to send, in international format without the plus sign.
First Name Optional first name of the contact being sent.
Middle Name Optional middle name of the contact being sent.
Last Name Optional last name of the contact being sent.
Company Optional company name of the contact being sent.
Quoted Message ID Optional ID of a message to quote in the chat when sending the contact message.

Output

JSON

  • chatId - The chat ID where the contact message was sent.
  • contact
    • phoneContact - The phone number of the contact sent.
    • firstName - The first name of the contact sent, if provided.
    • middleName - The middle name of the contact sent, if provided.
    • lastName - The last name of the contact sent, if provided.
    • company - The company name of the contact sent, if provided.
  • quotedMessageId - The ID of the quoted message, if any.
  • messageId - The ID of the sent contact message returned by the API.

Dependencies

  • Green API service credentials (instance ID and API token)

Troubleshooting

  • Common issues include invalid chat ID format or missing required fields like phone contact, which will cause the API request to fail.
  • Errors from the Green API such as network issues or invalid credentials will be reported with detailed messages including the data sent for easier debugging.
  • File reading errors do not apply here but similar errors in other operations indicate issues with file paths or permissions.

Discussion