Set Callback Webhook URL

Steps to add Webhook:

Step 1 -

  • To add a Webhook, you have to navigate to “Settings” that you can find in the “Configure” section.
  • In settings, navigate to Webhooks and then, click on "ADD NEW WEBHOOK".



Step 2 -

  • This will open a pop-up window, in which, you have to fill in the fields (Name, URL, Event Type, Condition) you can Test/Save the webhook here.



Set a callback URL for the event responses :

  • We have introduced a new feature where user can add a webhook and capture the responses. We have added the below events:

1. Template message sent

  • This event triggers when a user sends a template message.
  • Response:


                            
{
  "event_response_id": "e184970f-86b5-429a-9106-6c225eac3243",
  "event_type": "template_message_sent",
  "m_id": "gBEGkYY4ZIWGAgkjkZa9LCjDa8s",
  "wab_id": "{WhatsApp Business Number}",
  "receiver_num": "{Client Number}",
  "template_id": "a9a5d0ab-d6bf-4a78-9081-5998c5d924c6",
  "template_name": "daily_message_openingtime",
  "template_type": "image",
  "source": "API",
  "template_text": "Hi, Welcome to The Dining Club.😇\nPlease share your restaurant status for today.",
  "response_id": "e6d8bee0-001e-4ad2-a673-599c06b8261d",
  "status": "sent",
  "user_id": "763",
  "user_email": "{User Email}",
  "user_role": "AM",
  "created": "2023-05-13 05:28:21.183286"
}
                            
                          

2. Sent message delivered

  • This event triggers when your sent message is delivered to the user.
  • Response:


                            
{
  "event_response_id": "691c45e5-5c36-43e9-aac8-319809122cdf",
  "event_type": "sent_message_delivered",
  "wab_id": "{WhatsApp Business Number}",
  "receiver_num": "{Client Number}",
  "m_id": "gBEGkXASGGlVAgli1KiY6aV4jMQ",
  "timestamp": "2023-05-13 05:26:31",
  "status": "delivered",
  "user_id": "763",
  "created": "2023-05-13 05:26:32.588072"
}
                            
                          

3. Sent message read

  • This event triggers when your sent message is read by the user.
  • Response:


                            
{
  "event_response_id": "af61a341-53dd-4466-b497-847606ff712d",
  "event_type": "sent_message_read",
  "wab_id": "{WhatsApp Business Number}",
  "receiver_num": "{Client Number}",
  "m_id": "gBEGkXASGGlVAgmln5K_xBN_GME",
  "timestamp": "2023-05-13 05:24:56",
  "status": "read",
  "user_id": "763",
  "created": "2023-05-13 05:24:57.328354"
}
                            
                          

4. Message received

  • This webhook triggers whenever a user sends a message to your WhatsApp API number.
  • Response:


                            
{
  "event_response_id": "58a346c3-0e6f-46ee-8fe1-e5b190dca1e5",
  "event_type": "message_received",
  "wab_id": "{business_number}",
  "receiver_num": "{client_number}",
  "receiver_name": "Haritima",
  "m_id": "ABEGkZVpcQhWyus-sHPLi81t8KcJ6Q",
  "timestamp": "2023-05-13 05:20:52",
  "wab_response": {
    "messages": [
      {
        "text": {
          "body": "Hi"
        },
        "type": "text"
      }
    ]
  },
  "user_id": "763",
  "created": "2023-05-13 05:20:52.908031"
}
                            
                          

5. Session message sent

  • This event triggers when a user sends a session message.
  • Response:


                            
{
   "event_response_id": "5cc32a9b-8b78-410c-a9d2-171d731bea56",
   "event_type": "session_message_sent",
   "wab_id": "{WhatsApp Business Number}",
   "receiver_num": "{Client Number}",
   "m_id": "gBEGkXh1J5YCAgklX5QrJ967XJQ",
   "msg": "https://sdfvsdfvsdfvsdfvsdf.mp4",
   "msg_type": "audio",
   "is_media": "true",
   "user_id": "763",
   "sender_email": "{User Email}",
   "sender_role": "AM",
   "created": "2023-05-14 20:58:07.828103"
 }
                            
                          

6. Lead Capture

  • This event triggers when a new lead is created.

Note -

When an event sent to webhook it expects 200 response to confirm the event was successful. If it does not get the success response then it will be retried 10 more times after that the webhook URL will be inactive and you will get an email notification about this.