What can you do with it?

The WhatsApp API allows you to integrate WhatsApp messaging into your applications. You can send text messages, share media files, use pre-approved templates, check message delivery status, and manage contacts through your WhatsApp Business account.

How to use it?

Basic Command Structure

/your-whatsapp-connection [action] [required-parameters] [optional-parameters]

Parameters

Required:

  • action - The action to perform (send_text, send_media, send_template, get_status, manage_contacts)
  • to - Recipient phone number (for messaging actions)
  • message_content - Content of the message to send

Optional:

  • media_url - URL for media files
  • caption - Caption for media messages
  • template_name - Name of the template to use
  • language_code - Language code for templates

Tools

Send Text Message

Send a text message to a user’s WhatsApp number.

Parameters:

  • to (required) - Recipient phone number
  • message (required) - Text message content

Example:

/your-whatsapp-connection
action: send_text
to: +1234567890
message: Hello, this is a test message.

Response:

{
  "messages": [
    {
      "id": "wamid.HBgMNTg1Mjg3NTY4NzU5FQIAERgSODg3RDI1Q0Y2QjYzQzYxNjY1AA=="
    }
  ]
}

Send Media Message

Send an image, document, or other media file to a user’s WhatsApp number.

Parameters:

  • to (required) - Recipient phone number
  • media_type (required) - Type of media (image, document, video, audio)
  • media_url (required) - URL link to the media file
  • caption (optional) - Caption for the media

Example:

/your-whatsapp-connection
action: send_media
to: +1234567890
media_type: image
media_url: https://example.com/image.jpg
caption: Check out this image!

Response:

{
  "messages": [
    {
      "id": "wamid.HBgMNTg1Mjg3NTY4NzU5FQIAERgSODg3RDI1Q0Y2QjYzQzYxNjY1AA=="
    }
  ]
}

Send Template Message

Send a pre-approved template message to a user’s WhatsApp number.

Parameters:

  • to (required) - Recipient phone number
  • template_name (required) - Name of the approved template
  • language_code (required) - Language code (e.g., “en_US”)
  • parameters (optional) - Template parameters if needed

Example:

/your-whatsapp-connection
action: send_template
to: +1234567890
template_name: hello_world
language_code: en_US

Response:

{
  "messages": [
    {
      "id": "wamid.HBgMNTg1Mjg3NTY4NzU5FQIAERgSODg3RDI1Q0Y2QjYzQzYxNjY1AA=="
    }
  ]
}

Get Message Status

Check the delivery status of a previously sent message.

Parameters:

  • message_id (required) - ID of the message to check

Example:

/your-whatsapp-connection
action: get_status
message_id: wamid.HBgMNTg1Mjg3NTY4NzU5FQIAERgSODg3RDI1Q0Y2QjYzQzYxNjY1AA==

Response:

{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "recipient_phone_number",
      "wa_id": "recipient_whatsapp_id"
    }
  ],
  "messages": [
    {
      "id": "wamid.HBgMNTg1Mjg3NTY4NzU5FQIAERgSODg3RDI1Q0Y2QjYzQzYxNjY1AA==",
      "status": "delivered",
      "timestamp": "2025-01-14T12:34:56Z"
    }
  ]
}

Manage Contacts

Add or validate contacts in your WhatsApp business account.

Parameters:

  • phone_number (required) - Contact phone number
  • whatsapp_id (optional) - WhatsApp ID if known

Example:

/your-whatsapp-connection
action: manage_contacts
phone_number: +1234567890
whatsapp_id: recipient_whatsapp_id

Response:

{
  "contacts": [
    {
      "input": "+1234567890",
      "status": "valid",
      "wa_id": "recipient_whatsapp_id"
    }
  ]
}

Notes

Requires a WhatsApp Business account and approved phone number. Template messages must be pre-approved by WhatsApp before use. Media files should be hosted on publicly accessible URLs. Phone numbers should include country code. Message delivery status includes: sent, delivered, read, and failed.