Integrate Webhook with bot

Prerequisites

Customer needs to provide the webhook link that needs to be integrated with the bot. For our internal testing, we can use the testing link given in (https://webhook.site/))

Steps

  1. Copy the link pointed out in the screenshot below from the testing webhook link.

  1. Paste the link in the postback url box in the preferences tab of your bot.

  2. Run a whatsapp campaign for your internal testing

  3. Send a notification API to the bot to observe any hits on the webhook link.

curl --location --request POST ‘https://app.yellowmessenger.com/api/engagements/notifications/v2/push?bot=botID’ \

–header 'x-auth-token: ’ \

–header ‘Content-Type: application/json’ \

–data-raw '{

“userDetails”: {

“number”: “910000000000” // whatsapp number that will receive the notification

},

“notification”: {

“type”: “whatsapp”,//channel

“sender”: “910000000000”,//Whatsapp number of the bot

“templateId”: “template name”,

“params”: {

“firstName”: “”

}

}

}’

  1. If everything works as expected, we will see the hits on the webhook as per screenshot below:

  1. Replace postback URL added in step 2 with the actual webhook link customer would like to use.

Campaign Reports Integration with webhook

As of now, the feature to receive campaign reports via webhook is not available. Customers can only view status of individual messages sent.

The only way to receive campaign reports would be from Preferences tab in Engagement section (screenshot below):