Outgoing Webhooks allows you to set up a Webhook or API call to a system other than CustomerGauge whenever an specified event happens. This is ideal if a portion of your organization closes the loop in another system, or if you'd like your survey feedback to flow back into a data warehouse.


Disclaimer: Outgoing Webhooks require technical expertise to be set up and maintained.



Managing Outgoing Webhooks


Creating a new Outgoing Webhook


1. Navigate to Data → Integrations → Webhooks → Outgoing Webhooks.



2. Click on +New Webhook.



3. Select the event type and then click on Create. The webhook will be triggered when the selected event happens.

Responses: the webhook will be triggered when a survey has been responded.

Close the Loop Status: the webhook will be triggered when a Case status is updated.

Close the Loop Assignee: the webhook will be triggered when the Case assignee is updated.

Close the Loop Note: the webhook will be triggered when a new note is added to a Case.



4. In the Settings step all General Settings are required, while Filters are optional. After filling those fields, click on Save and Next.

General Settings

    Webhook Name: provide a name for your webhook.

    Method: select the request method, values are POST, PUT and PATCH.

    URL: provide the endpoint URL that the request is going to be sent to.

       For Salesforce use only:


Filters: select any survey filter as a condition for the webhook event to be triggered. Only records that match the filter criteria will be able to trigger the webhook.



5. In the Authentication step select the Authentication Type (Basic, Connected Apps - OAuth2 or None) and then click on Save and Next.

Authentication Type

    None: no authentication data will be sent in the request.

    Basic: a simple authentication with username and password will be sent in the request.

    Connected Apps: select from a list of OAuth2 authentications created via the Connected Apps feature.



6. In the Request step you are able to build your request body and headers. The request body will be based on the Content Type selected. After setting up the request, click on Save and Next.

Content Type
JSON: in this content type the Name and Values provided will be formatted in a valid JSON request body. In the Name column you should add the name of the field that would like the data to be added in your system, in the Value column you are able to add a static value or select merge tags that will be populated with your CustomerGauge data by clicking on


x-www-form-urlencoded: in this content type the Name and Values provided will be formatted in a valid URL-encoded request body. In the Name column you should add the name of the field that would like the data to be added in your system, in the Value column you are able to add a static value or select merge tags that will be populated with your CustomerGauge data by clicking on


Raw (JSON): in this content type you are free to build your own request body, the request must be a valid JSON in order to saved. In the Request body you should add the name of the field that would like the data to be added in your system and also add a static value or select merge tags that will be populated with your CustomerGauge data by clicking above on


Request Body - For Salesforce use only:

The `name` column in CustomerGauge can be found in Salesforce, as shown in the image below.



Response Example for Additional Questions and Drivers merge tag

{
  "Questions": "[{\"id\":16,\"question\":\"Add. Comment (Survey Suite)\",\"answer\":\"add comment\"},{\"id\":15,\"question\":\"CES 1-7\",\"answer\":\"5\"},{\"id\":17,\"question\":\"CSAT 1-10\",\"answer\":\"4\"}]",
  "Selected Drivers": "[{\"primary\":\"Ordering\",\"secondary\":[\"Ease of Ordering\",\"Product Information\"]}]"
}


7. In the Activation step you are able to activate the webhook and also set up an email alert when the HTTP request fails.

Note: leaving the Send alert to field empty will disable the failure alert.






Diagnosing Failures


Navigate to Data → Integrations → Webhooks → Outgoing Webhooks find the webhook you want to checked the failures and click on


In the Deliveries page you have an overview of all requests sent. You are also able to click on the row to expand it and reveal the Request body and Response body.

Status: the status column shows if a request has been processed or failed to be processed. After a request is processed it is then sent to the webhook endpoint.

HTTP Response: this is the HTTP code returned when the sent request has reached the endpoint. Hovering this column shows the code translation.

Request Method: this column shows the HTTP method used to send the request, it can be POST, PUT or PATCH.

Request Date: this shows when the request has been sent.

Request URL: this column shows the URL the request was sent to.






Responses - Test Webhook


Navigate to Data → Integrations → Webhooks → Outgoing Webhooks find the webhook you want to checked the failures and click on and then on Test Webhook button.



For the Responses event you are able to test the webhook by providing the CGID of a response record. When submitting the CGID, the webhook will be triggered just like it would normally trigger when a survey has been responded, taking the filters into consideration and sending the request body to the endpoint URL. You may use this feature test your webhook setup but also to manually trigger the webhook.


---------------


Integrating with Salesforce? Read this to help on the authentication