Skip to main content

Zendesk

Connect your Zendesk support platform to Squid to query and create issues

Creating a Zendesk API Token

Requests to the Zendesk REST API require an API token generated from Zendesk's admin dashboard. To create an API token, follow the steps in Zendesk's documentation for Generating API tokens.

Adding the Zendesk connector to your Squid application

  1. Navigate to the Connectors tab in the Squid Console.

  2. Click Available Connectors.

  3. Find the Zendesk connector, and select Add Connector.

  4. Provide the following configuration details:

Connector ID: A string that uniquely identifies the connector in your code.

Domain: The domain to your Zendesk instance. For example, if your Zendesk instance is at https://mycompany.zendesk.com, you would enter mycompany.zendesk.com.

Email: The email address for the account you want Squid to log into Zendesk with.

API Token: The token key generated by Zendesk.

Sync Help Center to Knowledge Base: Enable indexing Zendesk Help Center articles in a knowledge base for semantic search over documentation and FAQs. Defaults to off.

The Zendesk connector's functionality

The Zendesk connector currently enables Squid AI agents to query for tickets, create tickets, and delete tickets. By providing AI agents with these capabilities, users can simply ask the AI agent to interact with tickets on their behalf. The connector can also index your Help Center articles as searchable knowledge (see below).

If you are interested in learning more about how to use this feature, it is recommended to read the Zendesk REST API documentation. This will give users a better sense of what fields can be queried, what properties are necessary for creating an issue, and more.

While a better understanding of the underlying API will allow the user to use this feature more effectively, it is not a requirement as the AI agent will respond with messages asking for the missing details.

Help Center knowledge base

When Sync Help Center to Knowledge Base is enabled, Squid indexes your Help Center articles into a knowledge base, refreshing every 10 minutes (the initial sync covers roughly the last year of articles). Agents connected to the Zendesk connector can then semantically search your documentation, guides, and FAQs, with results linking back to the source articles.

A few notes:

  • Articles from all brands and locales are indexed; draft articles are skipped.
  • Access is read-only: Squid never writes to your Help Center.

Using the Zendesk connector in your application

No-code Studio

No-code solutions can be created via the Squid Agent Studio.

  1. Navigate to the Studio tab in the Squid Console.

  2. Click Create AI Agent.

  3. Provide an agent ID and description, such as "zendesk-agent" and "This agent helps the user interact with Zendesk tickets".

  4. Click Add Abilities.

  5. Switch to the Existing tab and select the Zendesk connector you had created earlier.

  6. Give a description for how the agent should use this connection, such as "Call this when a user wants to interact with Zendesk tickets."

  7. Click on Test and try asking the agent "What are my tickets?".

Basic building blocks in code

To use the Zendesk connector in a Squid application, install the @squidcloud/zendesk npm package

npm install @squidcloud/zendesk

The Zendesk npm package provides AI functions used to call the Zendesk API. You will need to setup a Squid backend project in order to use the connector.

Exporting the Zendesk connector in the Squid backend adds the Zendesk AI functions to your project. In the src/service/index.ts, export the package in order to use it in your application.

export * from './your-service';
export * from '@squidcloud/zendesk';

In order to use the Zendesk AI functions, the AI agent must be connected to those functions. To do so, setup an AI agent profile in the Squid Console. If the backend is deployed, the AI agent will be able to access the AI functions in the dropdown in the console. If the backend is not deployed, the AI functions must be provided to the AI agent in your code. For example, if using the Squid Chat Widget, the AI functions can be provided in the squid-ai-functions-json parameter of the widget.

const aiFunctionContext = { integrationId: 'YOUR_ZENDESK_CONNECTOR_ID' };
const aiFunctionsJson = JSON.stringify([
{
name: 'createTicket',
context: aiFunctionContext,
},
{
name: 'getAllTickets',
context: aiFunctionContext,
},
{
name: 'getZendeskTicketsByRequester',
context: aiFunctionContext,
},
{
name: 'searchZendeskTickets',
context: aiFunctionContext,
},
{
name: 'deleteZendeskTicket',
context: aiFunctionContext,
},
{
name: 'getLoggedInUser',
context: aiFunctionContext,
},
{
name: 'getZendeskUserByEmail',
context: aiFunctionContext,
},
{
name: 'genericFallbackQueryFunction',
context: aiFunctionContext,
},
]);

const chatWidget = document.createElement('squid-chat-widget');
chatWidget.setAttribute('squid-ai-integration-id', 'ai_agents');
chatWidget.setAttribute('squid-app-id', 'YOUR_APP_ID');
chatWidget.setAttribute('squid-region', 'YOUR_REGION');
chatWidget.setAttribute('squid-environment-id', 'YOUR_ENVIRONMENT');
chatWidget.setAttribute('squid-developer-id', 'YOUR_DEVELOPER_ID');
chatWidget.setAttribute('squid-ai-agent-id', 'YOUR_AGENT_ID');
chatWidget.setAttribute('header-title', 'Zendesk AI');
chatWidget.setAttribute('squid-ai-functions-json', aiFunctionsJson);
chatWidget.setAttribute('intro-text', 'Hi, I am the Zendesk agent. How can I help?');
chatWidget.setAttribute('style', 'display: block; min-height: 350px; height: 75vh;');

const widgetContainer = document.getElementById('widget');
if (widgetContainer) {
widgetContainer.innerHTML = ''; // Clear any existing widget
widgetContainer.appendChild(chatWidget);
}

Those are the core building blocks to get the Zendesk connector up and running in your application. It may be simplest to copy the sample code and build from there.

Congratulations! You can now can ask questions to your AI agent about your Zendesk instance!