Introduction

You can use Incoming Webhooks to trigger a data import in CustomerGauge whenever an event happens in another system.



How to Setup

To be able to generate a webhook that can trigger survey invitations you will need an Inbound Mapping.


  • 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


When calling the webhook each inbound mapping type has a unique interaction:


Data TypeAdditional InformationRequired Fields
AccountsAccounts data type is used to add new accounts (if it does not exist) and update account data (if it exists). Account Name is used as the identifier.
  • Account Name
ContactsContacts data type is used to add new contacts (if it does not exist) and update contact data (if it exists). Here, Email or Phone is used as the identifier.
  • Email or Phone
SurveysSurveys data type is used to send survey invitations using a contact reference (phone or email).
Account and Contact data is auto-populated if nothing is provided. You can check the auto-populated fields when viewing or editing the surveys mapping.
  • Contact Reference (Phone or Email)
Multi-ObjectMulti-Object data type is used to add and update Account and Contact data while sending survey invitations.
  • Email or Phone
Account AliasesAccount Aliases data type is used to add alternate names for Accounts.
  • Account Name
  • Alias
ActivitiesActivities data type is used to add and update activities data to identify absence of signal.
  • Account Name
  • Reference
  • Source
  • Type
External ResponsesExternal Responses is used to add survey responses from other systems into CustomerGauge.
  • Email or Phone
  • Sent Date
  • Response Date



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"
}'