Introduction

You can use Incoming Webhooks to trigger a data import in CustomerGauge whenever an event happens in another system. This is a great alternative to calling our PUT /Record API, in case you're not able to use OAuth2 authentication in the calling system.



How to Setup

To be able to generate a webhook that can trigger survey invitations you will need an API Configuration. You can check how to set it up here.


  • Navigate to Data → Rest APIs → Inbound Mapping.
  • Under Actions, click on the 3 dots and then Generate Webhook.



  • Click on Save.



  • A webhook will be generated and all the necessary information will be shown.



If you need to check the webhook information and credentials at a later stage, you can do so by following these instructions:

  • Navigate to Data  Integrations Webhooks.
  • Under Actions, click on the 3 dots and then View. You can also Deactivate or Delete the webhook here as well.



Calling the Webhook


Authentication

The Webhook uses Basic Authentication - if your application does not support this by default, you'd want to send the Username and Password separated by a single colon, base64-encoded in the Authorization header of the request.


Base64.Encode( "{{username}}:{{password}}" )

Pseudo-code displaying how to generate the Authorization value - replace {{username}} and {{password}} with the details obtained from CustomerGauge.


Parameters

For each field you'd like to send as part of your survey request, you can simply send us the field name (as displayed in Field Settings) along with the value in parameters.


CURL Example

curl --location --request PUT 'https://hooks.eu.customergauge.com/xxxxxxxxxxxx?Email=john.doe@example.com' \
--header 'Authorization: Basic XXXXXXXX'


curl --location --request PUT 'https://hooks.eu.customergauge.com/xxxxxxxxxxxx' \
--header 'Authorization: Basic XXXXXXXX' --header 'Content-Type: application/json' --data-raw '{
"Email": "john.doe@example.com"
}'