# Zendesk

## Prerequisites

* A Zendesk account with admin access
* Zendesk Suite Professional plan or higher (required for WhatsApp)

## Setup

### Step 1: Enable Zendesk in Alhena

1. In Alhena, go to **Settings > Integrations**
2. Find **Zendesk** and click the toggle to enable it

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FafA6YGIuoDI8nbF0s7FJ%2FScreenshot%202024-05-23%20at%202.36.53%20PM.png?alt=media&#x26;token=182459d7-816c-4c3c-a4c6-872204793133" alt=""><figcaption></figcaption></figure>

When you enable the integration, Alhena creates a new agent in your Zendesk account called "Alhena Bot". The bot only responds to open tickets assigned to this agent.

***

## Triggers (for Email)

To have Alhena automatically respond to tickets, create a trigger in Zendesk to assign new tickets to the Alhena Bot agent.

### Setting Up a Trigger

1. In Zendesk, go to **Admin Center > Objects and rules > Business rules > Triggers**
2. Click **Add trigger**
3. Configure the trigger to assign new email tickets to Alhena Bot

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FaP8ZhJ681A8EvTb2ixaD%2FScreenshot%202024-05-23%20at%203.17.22%20PM.png?alt=media&#x26;token=d1bea687-820a-4956-b7fb-b716fa55a9f2" alt=""><figcaption><p>Example trigger to assign all new email tickets to Alhena</p></figcaption></figure>

Once Alhena answers a ticket, it moves it to closed status. Zendesk automatically reopens tickets when a customer replies, and Alhena will reply again.

***

## Email Tickets

Alhena can automatically respond to tickets in Zendesk created by email. For each new message in a ticket, Alhena generates an answer, transferring the ticket to a human agent when needed.

See [Human Transfer Triggers](https://alhena.gitbook.io/docs/integrations/helpdesk/human-transfer-triggers) for when Alhena hands off to human agents.

***

## Website Chat Tickets

Once you configure your Zendesk integration, Alhena syncs conversations from the Website SDK into Zendesk. You can see the conversations users are having with the bot in realtime from Zendesk.

When a ticket is transferred to human agents:

* The bot asks users for their email address
* Users can upload images and files for human agents to see
* Agents can send images and files back to the user

By default, website chat tickets appear similarly to email tickets inside Zendesk. You can optionally [configure the Sunshine Conversations API](https://alhena.gitbook.io/docs/integrations/helpdesk/zendesk/enabling-sunshine-api-for-website-tickets) for an improved live chat experience.

***

## WhatsApp Tickets

If you have WhatsApp configured in Zendesk, Alhena can respond to any tickets created through this channel. This requires access to the Sunshine Conversations API through the Zendesk Suite Professional plan or higher.

### Step 1: Enable the Zendesk Integration

First, make sure you've configured the Zendesk Integration with the [instructions above](#setup).

### Step 2: Enable WhatsApp in Alhena

1. In Alhena, go to **Settings > Integrations > Zendesk**
2. Enable the **WhatsApp** toggle

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2F4yG672S9enjAGu33NTwd%2FScreenshot%202024-07-09%20at%202.59.20%20PM.png?alt=media&#x26;token=089564e3-c79c-4729-a3ae-8c8c6b7833d5" alt=""><figcaption></figcaption></figure>

### Step 3: Create an API Key in Zendesk

1. Click **Create An API Key** in Alhena, or navigate to the Conversations API page in Zendesk admin panel under **Apps and integrations**

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FUTTcIEJYi63ttpuqioP9%2FScreenshot%202024-07-09%20at%203.01.50%20PM.png?alt=media&#x26;token=1f11ebfe-20ef-433a-9a55-6f2e0bf0527a" alt=""><figcaption></figcaption></figure>

2. Click **Create API Key** in the Zendesk admin panel
3. Name your API key (e.g., "Alhena AI")

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FAEBK3dtRYJ3qljMjSyPO%2FScreenshot%202024-07-09%20at%203.03.08%20PM.png?alt=media&#x26;token=b554d00c-dc66-40af-b573-9fa09c1729ef" alt=""><figcaption></figcaption></figure>

### Step 4: Connect the API Key

1. Copy each of the three values from Zendesk's admin panel into Alhena's dashboard

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2F4uAjscjqCTsa6wAnwkur%2FScreenshot%202024-07-09%20at%203.03.54%20PM.png?alt=media&#x26;token=48297153-59fe-4687-9ca4-9f3b2d884793" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FKWSt7DxjQrAbprJ02vhk%2FScreenshot%202024-07-09%20at%203.03.58%20PM.png?alt=media&#x26;token=31ec7394-a97a-4de1-a5c4-d033d660fb60" alt=""><figcaption></figcaption></figure>

2. Click **Connect** in Alhena's dashboard

Your bot will now automatically reply to any WhatsApp tickets assigned to the "Alhena Bot" agent. You will most likely want to set up a [trigger in Zendesk](#triggers-for-email) to automatically assign tickets to the bot.

### How It Works

1. A user sends a message to your WhatsApp number, and a new ticket is created in Zendesk
2. There will be some delay before Alhena starts processing the ticket (due to Zendesk limitations, it may take a couple of minutes)
3. Alhena waits until the message is at least 30 seconds old to start processing, since WhatsApp users may type multiple messages in a row or need time to attach images
4. Alhena processes the messages and images it received together and generates an answer

***

## Bot Profile Mapping

If you have multiple bot profiles for your organization in Alhena, you can route tickets from the same Zendesk account to the appropriate bot profile. For example, you might have multiple products or websites where the tickets go to the same Zendesk account.

[Contact support](https://alhena.gitbook.io/docs/troubleshooting/troubleshooting#contact-support) to configure this mapping. We support mapping for common Zendesk configurations like multiple email addresses or multiple WhatsApp numbers.

***

## FAQs

### How can I correct incorrect answers for tickets in Zendesk?

If you find a ticket where the bot gave a wrong answer, you can use the ticket ID to search in Alhena's dashboard and see the answer sources used.

1. Find the ticket ID in Zendesk

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2Fz9E7HrG63rWuI9dLGpEg%2FScreenshot%202024-05-24%20at%2010.35.56%20AM.png?alt=media&#x26;token=1d4d79aa-d901-497b-b188-57ca3ba696df" alt=""><figcaption></figcaption></figure>

2. Enter this ticket ID into the search box in Alhena to locate the ticket and see the answer sources. You can also search by any text in the messages, phone number, or email address.

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FSUf6SGZ96Y7dWo1MtDB5%2FScreenshot%202024-05-24%20at%2010.36.31%20AM.png?alt=media&#x26;token=0b8111d4-320f-4bda-a2fc-0e3392de087e" alt=""><figcaption></figcaption></figure>

3. From there, you can open links to the information Alhena used to generate the answer, edit existing feedback, or add new feedback.

### Can I train my bot on past ticket responses in Zendesk?

Yes. Contact the Alhena team for assistance.

### Can I train my bot on Zendesk macros?

Yes. Contact the Alhena team for assistance.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alhena.gitbook.io/docs/integrations/helpdesk/zendesk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
