Connect to 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
Navigate to the Connectors tab in the Squid Console.
Click Available Connectors.
Find the Zendesk connector, and select Add Connector.
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.
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.
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.
Using the Zendesk connector in your application
No-code Studio
No-code solutions can be created via the Squid Agent Studio.
Navigate to the Studio tab in the Squid Console.
Click Create AI Agent.
Provide an agent ID and description, such as "zendesk-agent" and "This agent helps the user interact with Zendesk tickets".
Click Add Abilities.
Switch to the Existing tab and select the Zendesk connector you had created earlier.
Give a description for how the agent should use this connection, such as "Call this when a user wants to interact with Zendesk tickets."
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!