Zendesk Integration Guide

This guide will cover how to integrate data from your Zendesk account into flows in Cue.

Overview

  1. Requirements for Integration
  2. Authenticating Zendesk API requests
  3. Make API requests to Zendesk from a Cue Flow
  4. Find Zendesk tickets
  5. Create a Zendesk ticket
  6. Update or close a Zendesk ticket

Requirements for Integration


To set up this integration, you will need:

  1. Zendesk API Token: An API token and the email address of an active agent or administrator associated with your Zendesk account.
  2. Zendesk Subdomain: Your Zendesk domain (e.g. yourcompany.zendesk.com).
  3. Cue Workspace Access: Access to "Flows" within your Cue workspace (e.g. an Admin role).

Authenticating Zendesk API requests

Once you have your Zendesk API token you can store it as an encrypted secret within with your flow and then use it when making HTTP Requests in your flow.

Add the Zendesk API token to your flow

  1. Open your flow
  2. Click the   icon in the top right corner of your screen and select Secrets
  3. Click Add secret
  4. In the Key field give your secret a name (e.g. TOKEN)
  5. In the corresponding 'Value' field paste in your Zendesk API token
  6. Click Save

This saves your Zendesk API token in an encrypted format and now allows you to use it in HTTP requests by typing {{secrets.TOKEN}} (or whatever you've named your key). When the HTTP step is executed, the above placeholder will be replaced with the actual API token you saved as a secret.

Use the Zendesk API token secret in an HTTP Request

To use your Zendesk API token secret in an HTTP Request you can do the following:

  1. Create an HTTP Request step in your flow and click on it to open the step settings panel.
  2. Expand the Authorization section and select Basic Auth from the drop-down.
  3. In the Username field put the email address you are using followed by /token for example youremail@domain.com/token
  4. In the Password field put {{secrets.TOKEN}}
  5. Set the remaining details for your HTTP request such as method, url, body etc and save the changes.

Now your HTTP step will use your Zendesk API token to make authenticated requests to your Zendesk account using the Basic Authentication process.

Make API requests to Zendesk from a Cue flow

Once you've got your Zendesk API key saved as a secret in your flow you can use it to make API requests to Zendesk API endpoints. Let's take a look at a few examples of what you can do with the Zendesk API now.

Find Zendesk tickets

Get a single ticket

To retrieve the details of an existing Zendesk ticket, you'll use the GET method with the ticket's ID.
HTTP Method: GET
Request URL: https://{your_subdomain}.zendesk.com/api/v2/tickets/{ticket_id}.json
Replace {ticket_id} with the actual ID of the ticket you want to retrieve.

Get a list of tickets

If you want to list all tickets you can make a GET request to the following URL:
https://{your_subdomain}.zendesk.com/api/v2/tickets.json

See Zendesk's List Tickets API docs for more detail.

Create a Zendesk ticket

To create tickets we make POST requests to the following endpoint:
https://{your_subdomain}.zendesk.com/api/v2/tickets.json

Below is a sample of the required JSON

{
  "ticket": {
    "subject": "Test ticket from Cue",
    "comment": { "body": "This is a test ticket created via Cue" },
    "priority": "normal"
  }
}

and here is an example of how you would set up a request like this in your Cue flow:

If your request is successful you can extract the ticket_id from the response to your request.

Update or close a Zendesk ticket

To update or close a ticket in Zendesk, send a PUT request to:
https://{your_subdomain}.zendesk.com/api/v2/tickets/{ticket_id}.json

Refer to the Zendesk Update Ticket API docs for details on which fields you can modify. For example, you can set the status field to solved  if the issue has been resolved and closed if the ticket is finalized and cannot be reopened.

You can also update the ticket’s priority, assignee, or add internal notes depending on your needs.

Save a Cue conversation transcript to a Zendesk ticket comment

If you want to save a Cue conversation transcript to a Zendesk ticket you can add a comment to a ticket by making a PUT request to the following endpoint:

https://{your_subdomain}.zendesk.com/api/v2/tickets/{ticket_id}.json

You can use the conversation.plainText property in flows to produce an entire transcript of the conversation that can be passed into the body property of the comment request body.