WhatsApp Automation Connector

Connect your WhatsApp account and start automating your messages

1. Connecting to WhatsApp

  1. Open the web page for this application in your browser.
  2. You will be asked to log in. Your administrator should have provided you with a username and password.
  3. Click the Connect to WhatsApp button.
  4. A QR code will appear on the screen. Open WhatsApp on your phone, go to Settings > Linked Devices, and scan the QR code.
  5. Once you have scanned the QR code, your WhatsApp account will be connected, and you can start using the automation features.

2. Getting Your API Key

To use the API to send messages and set up webhooks, you will need an API key.

  1. Once you are connected to WhatsApp, your API key will be displayed on the web page.
  2. Copy the API key and save it in a safe place. You will need it for all API requests.

3. Sending Messages

You can send messages to any WhatsApp number using the API.

To send a message, you will need to make a POST request to the /api/whatsapp/send endpoint.

Endpoint:

POST /api/whatsapp/send

Headers:

  • Authorization: Bearer YOUR_API_KEY

Request Body:

{
  "recipient": "+1234567890",
  "message": "Hello, world!"
}

Replace +1234567890 with the recipient's phone number in international format, and Hello, world! with your message.

4. Receiving Messages (Webhooks)

You can receive incoming WhatsApp messages by setting up a webhook.

A webhook is a URL on your own server that will be called every time a new message is received.

To set up a webhook, you will need to provide a URL and an optional API key.

  1. On the web page, you will find a section for Webhook Settings.
  2. Enter the URL of your webhook in the Webhook URL field.
  3. If your webhook requires an API key for authentication, enter it in the API Key field.
  4. Click the Save Webhook button.

Now, every time you receive a new message, it will be sent to your webhook URL.

Webhook Payload

The webhook request will be a POST request with a JSON body containing the message data.

{
  "id": "MESSAGE_ID",
  "from": "SENDER_JID",
  "text": "Hello, world!",
  "timestamp": "2024-05-14T10:00:00.000Z",
  "isFromMe": false,
  "mediaUrl": "BASE64_ENCODED_IMAGE_DATA"
}

Troubleshooting

  • I can't connect to WhatsApp: If you are having trouble connecting, try clicking the Disconnect button and then connecting again.
  • I'm not receiving messages: Make sure that your webhook URL is correct and that your server is running.