Introduction



In this article you will learn how you can create a Support Ticket in Zendesk when a CustomerGauge survey gets completed using our Outgoing Webhooks Functionality. This helps if your organization is Closing the Loop using Zendesk. 


In order to leverage this Outgoing Webhooks you do need to be a customer of both Zendesk and CustomerGauge.



Business use case

Creating a Support Ticket in Zendesk whenever a CustomerGauge survey gets completed greatly helps if you're Closing the Loop using Zendesk.




Preparations

Requirements

In order to set up an Outgoing Webhook to Zendesk, you'll need the following:

  • Admin access in CustomerGauge;
  • Admin access in Zendesk;
  • A Zendesk user that will be used for the integration;
  • A high enough Rate Limit in your Zendesk package to cope with your survey volume.



Authentication

Each of the recipes for Zendesk will require a valid authentication. Zendesk supports different ways of Authentication; OAuth2 - Resource Owner Password Credentials, or Basic Authentication using API Token. It's generally preferred to authenticate by OAuth2, with the API Token used if you can't authenticate through OAuth2 for any reason. Whichever method you choose, you should follow the appropriate steps as described below for each of your Outgoing Webhooks to Zendesk.


OAuth2 - Resource Owner Password Credentials

  1. In Zendesk, head over to the OAuth Clients tab in Admin → Channels → API.
  2. Create a new OAuth Client:
    1. Client Name: Give a name to your OAuth client that you'll recognize in the future.
    2. Description: You could expand here what the purpose of this OAuth client is for. Filling in this field is optional.
    3. Company: You can leave this to its default value, it won't be relevant for the Outgoing Webhook.
    4. Logo: You can skip this field, it won't be relevant for the Outgoing Webhook.
    5. Unique Identifier: This field is important - this will be the Client ID you'll use to set up the Authentication in CustomerGauge. A suggestion is made based on the Client Name.
    6. Redirect URLs: You can skip this field, it won't be relevant for the Outgoing Webhook.
    7. Secret: Upon saving the OAuth Client a secret will be displayed - store this in a save place, you can not obtain it again. If you happen to lose the secret, you can Regenerate it, but that breaks any connection using this OAuth Client.
  3. In CustomerGauge, head to Data → Integrations → Webhooks → Authentications.
  4. Create a New Authentication:
    1. System: Select "Other".
    2. Name: Give your Authentication a name that you'll recognize in the future.
    3. Grant Type: Select "Resource Owner Password Credentials".
    4. Access Token URL: Add the following URL, replacing <domain>with your Zendesk domain:
      https://<domain>.zendesk.com/oauth/tokens
    5. Username: Add the username of the Zendesk user you'd like to use for the integration.
    6. Password: Add the password of the Zendesk user you'd like to use for the integration.
    7. Client ID: Copy/Paste the value from the "Unique Identifier" of the OAuth Client you created in Zendesk.
    8. Client Secret: Copy/Paste the "Secret" of the OAuth Client you created in Zendesk.
    9. Scope: You can ignore this option for Zendesk.
  5. Press the Save button, and you should be ready to set up your Outgoing Webhook!


Basic Authentication with API Key

  1. In Zendesk, head over to the Settings tab in Admin → Channels → API.
  2. On this screen, ensure that "Token access" is turned on, and press the Add API Token button.
    1. Description: You could expand here what the purpose of this API Token is for. Filling in this field is optional.
    2. API Token: An API Token will be displayed - store this in a save place, you can not obtain it again. If you happen to lose the secret, you will need to create a new API Token.
  3. Base64 Encode the value <email_address>/token:<api_token>, replacing <email_address> with the email address of the Zendesk user of the integration, and <api_token> with the API Token obtained from Zendesk.
    • Example: using the Email Address "j.doe@example.com" and API Token "ABC" this would look like "j.doe@example.com/token:ABC" before Base64 Encoding, and would be "ai5kb2VAZXhhbXBsZS5jb20vdG9rZW46QUJD" after Base64 Encoding.
  4. In CustomerGauge, when setting up your Webhooks add the following Custom Header in the Custom Headers section:

    HeaderValue
    AuthorizationBasic <base64-encoded api_token>

    Your Custom Header should look like this after adding.


  5. Your authentication should be all set up!




Create a Support Ticket when a Survey gets completed


How to set-up

  1. In CustomerGauge, in the Outgoing Webhooks page, click the New Webhook button, followed by the Outgoing option.

  2. In the Filters step you can add a combination of fields and their value that a survey response needs to match in order to trigger the Webhook.
    Survey Responses that have Touchpoint "Support", and Area being either "British Isles" or "Benelux" qualify to trigger this Webhook.

  3. In the Authentication step, if you are authenticating through OAuth2, select your Authentication from the drop-down. If you're authenticating using API Token, you can simply press Next.

  4. In the API Setup step you'll need to set up your API request. We'll walk you through each of the fields that you'd need to fill in to create a Support Ticket in Zendesk.
    1. Method: POST
    2. API URL:
      https://<domain>.zendesk.com/api/v2/tickets
    3. Custom Headers:Add the following header to the Custom Header section:
      HeaderValue
      Content-Typeapplication/json

      If you're authenticating using Basic Authentication, an additional Custom Header is needed, as described above in the Basic Authentication with API Key section.

      If using Basic Authentication, you'd have two Custom Headers.


    4. Request Body: The Request Body is used to send your Survey Response data to Zendesk. This is your mapping between CustomerGauge and Zendesk. We'll provide an example, but you may want to make changes to add data important to you. See the list of Available Data Fields to find out what data is available from CustomerGauge to be sent over. Zendesk's capabilities are described in their API documentation.

      Example Request Body:
      {
      "ticket": {
      "comment": {
      "body": "The smoke is very colorful."
      },
      "priority": "urgent",
      "subject": "My webhook is on fire!"
      }
      }
  5. In the Details step, the last step, give a name to your Webhook, and decide to Activate the Webhook immediately or not. Once you've done that, click the Save button, and you're all done! You can see whether your Webhook being (de-)activated in the Status column in the overview of Webhooks. If you'd like to activate or deactivate your Webhook at a later time you can always Edit your Webhook and navigate to the Details step to activate or deactivate it.