# How to Automate CSAT Surveys on WhatsApp with Gallabox Webhooks

### Overview

Manually sending CSAT surveys or WhatsApp Messages can be time-consuming and error-prone. With Gallabox's webhook integration, you can automate this process and gather valuable customer insights.

This guide will walk you through the steps of setting up a webhook to trigger CSAT WhatsApp message templates automatically when conversations are resolved, simplifying your customer feedback collection process.

{% hint style="info" %}
Pre-requisites:

1. Should have a WhatsApp Message Template ready in the Gallabox. &#x20;
2. Should have a Admin or Owner access for Gallabox.&#x20;
3. Should be in a Scale plan or above.&#x20;
   {% endhint %}

### Generic Webhook Integration

In your Gallabox Account, from left navigation go to Integrations. Select 'Generic Webhooks' from the list of Available Integrations.&#x20;

<figure><img src="https://33771963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPdT5fOiFJnHBqGdwIkkL%2Fuploads%2FmwRgEfdDaakve2AXqdUK%2FGeneric%20Webhook%20Integration.gif?alt=media&#x26;token=353894e0-c9cb-4ceb-8791-3f4a97e14b54" alt=""><figcaption></figcaption></figure>

### Connect Generic Webhook Integration

To connect 'Generic Webhook', enter the webhook name to generate a Webhook URL. This Webhook URL will be used while creating a Webhook in the next step.&#x20;

<figure><img src="https://33771963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPdT5fOiFJnHBqGdwIkkL%2Fuploads%2F9iy0T6Uo262fKooypJGq%2FGeneric%20Webhook%20connection.gif?alt=media&#x26;token=f907de02-d134-4386-96cd-5c49ed14eedb" alt=""><figcaption></figcaption></figure>

### Create a Webhook

Select the Channel with which you would like to send the Feedback WhatsApp Messages. Copy the Webhook URL generated and navigate to Webhooks under settings. Create a New Webhook URL. Paste the Webhook URL from previous step & choose the action as  `conversation.resolve`

<figure><img src="https://33771963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPdT5fOiFJnHBqGdwIkkL%2Fuploads%2FoGXGZ4oaYqS0O0gcO1Wr%2FCreate%20a%20Webhook.gif?alt=media&#x26;token=66f2585e-b295-4398-9b4a-20f5409a47fe" alt=""><figcaption></figcaption></figure>

### Test the Webhook

To test the webhook, go to Generic Webhook Connection you created and click on 'Capture Webhook Response'.  Go and resolve a test conversation for the value to be captured by this webhook. You will see the headers under which the values are stored. Use these headers for the conditions in the workflow in the next step.&#x20;

<figure><img src="https://33771963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPdT5fOiFJnHBqGdwIkkL%2Fuploads%2FnbbyGxEBHkh7TA5CTbuz%2FTest%20the%20Webhook%20created.gif?alt=media&#x26;token=aa567fac-8978-44e4-b237-0ff530ded052" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Make sure to choose the WhatsApp Channel and update the configuration.&#x20;
{% endhint %}

### Create a Workflow in Generic Integration section

To create a workflow, click on 'Create New Workflow'. Enter the workflow name, conditions, pick a WhatsApp message template to be sent, and add actions. Click on 'Create Workflow'.&#x20;

Enter the name for the Workflow, choose 'ALL' from the dropdown for conditions. The conditions you have to enter are:&#x20;

<table><thead><tr><th width="324" align="center">Comparator</th><th width="143" align="center">Operator</th><th align="center">Value</th></tr></thead><tbody><tr><td align="center">channel.whatsapp.whatsappnumber</td><td align="center">Equal</td><td align="center">917825877797 (<em>enter your business WhatsApp Number</em>)</td></tr><tr><td align="center">user.name</td><td align="center">Is not Empty</td><td align="center"></td></tr><tr><td align="center">assigneeType</td><td align="center">Equal</td><td align="center">user</td></tr></tbody></table>

Choose the desired WhatsApp Message Template you have created asking for the chat feedback. For the Recipient Name and Recipient Phone use the variables as `{{body.contact.name}}` and `+{{body.contact.phone}}` respectively.&#x20;

{% hint style="info" %}
Make sure to add + before `{{body.contact.phone}}` variable. If you didn't an error will show and no WhatsApp Message will be shared with the customers.&#x20;
{% endhint %}

You could add an action like 'Update Contact tags' to mark the contacts who provided the feedback for the chat with your customer support team. Click on 'Create Workflow' at the end to activate the workflow.&#x20;

<figure><img src="https://33771963-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPdT5fOiFJnHBqGdwIkkL%2Fuploads%2F484eFQV8wpflV3FjWAsX%2FWorkflow%20CSAT.gif?alt=media&#x26;token=f9550a20-a983-4100-ae9a-0c6a0613c541" alt=""><figcaption></figcaption></figure>

### Ending Note

After this workflow is created, when a chat is resolved in Gallabox, a WhatsApp Message Template asking for a feedback will be shared with your customers.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.gallabox.com/how-to-automate-csat-surveys-on-whatsapp-with-gallabox-webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
