# How to configure a connection to Zendesk

To use the **Zendesk** support platform with B2CORE, configure a connection to Zendesk. Once configured, clients can click the **HelpDesk** menu in the B2CORE UI or [mobile app](https://docs.b2core.b2broker.com/release-notes/release-notes-mobile) to be redirected to the Zendesk interface via single sign-on (SSO), eliminating the need for additional authentication. In Zendesk, they can submit and manage tickets, access live chat support, and utilize AI-powered features to receive assistance.

{% hint style="info" %}
Before configuring a connection in the Back Office, you must have signed up for Zendesk and have an active account with the configured SSO options. You can consult the official [Zendesk documentation](https://support.zendesk.com/hc/en-us) or contact their support in case you have any questions.
{% endhint %}

To configure a connection in the B2CORE Back Office:

{% stepper %}
{% step %}
Navigate to **System** > **External connections**.
{% endstep %}

{% step %}
Click **+Create** in the upper-right page corner.
{% endstep %}

{% step %}
On the **Create connection** page, fill in the following fields:

* In **Name** field, enter a unique name for the connection.
* In the **Caption** field, enter a caption that will be applied to the connection in the Back Office.
* In the **Provider** dropdown, select **Zendesk**.
  {% endstep %}

{% step %}
Click **Save** to create the connection.
{% endstep %}

{% step %}
Find the newly created connection in the list and click **Edit**.
{% endstep %}

{% step %}
On the **Edit connection** page, fill in the following fields:

#### Common settings

* In the **Zendesk URL** field, specify your Zendesk URL, such as:

  `https://{your-subdomain}.zendesk.com`

This URL is used by Zendesk to call API methods to verify JSON Web Tokens (JWTs) required for single sign-on from your mobile app.

Ensure that this URL is also entered and saved in your Zendesk **Admin Center** while configuring SSO for the mobile SDK in **Channels** > **Mobile SDK** menu.

<figure><img src="https://514898401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGoRxAprhHu1goANW7FXt%2Fuploads%2Fgit-blob-f454bd96a71e10d3f7095c2ff54418ededc947be%2Fzd-mobile-sdk-zendesk-url.png?alt=media" alt="Zendesk URL in Channels > Mobile SDK"><figcaption><p>Zendesk URL in Channels > Mobile SDK</p></figcaption></figure>

* In the **SSO Redirect URL (brand url)** field, specify the URL of the Zendesk page to which your clients will be redirected after successful authentication via single sign-on, such as:

  `https://{your-subdomain}.zendesk.com/hc/en-us`

#### SSO Settings

* In **SSO Shared Secret** field, specify the secret from Zendesk, which is used to generate JWTs required for single sign-on.

This secret is generated in the Zendesk **Admin Center** during SSO configuration and must be copied from there.

<figure><img src="https://514898401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGoRxAprhHu1goANW7FXt%2Fuploads%2Fgit-blob-7158396f697aa47bf9da4643ce28397ac5d72e3c%2Fzd-shared-secret.png?alt=media" alt="Shared secret in Zendesk"><figcaption><p>Shared secret in Zendesk</p></figcaption></figure>

#### Mobile SDK Settings

These settings are required only if you have a [mobile app](https://docs.b2core.b2broker.com/release-notes/release-notes-mobile) and need to enable SSO between your app and Zendesk. If you don't have the mobile app, these settings aren't necessary.

* In the **App ID** field, specify the app identifier from Zendesk.
* In the **Client ID** field, specify the client identifier from Zendesk.
* In the **SDK JWT Secret** field, specify the secret generated in Zendesk, which is used to sign JWTs sent from B2CORE to Zendesk for single sign-on.

All these values are generated in your Zendesk **Admin Center** when configuring SSO for the mobile SDK in the **Channels** > **Mobile SDK** menu and must be copied from there.

#### Mobile SDK in Zendesk

In Zendesk **Admin Center** in **Channels** > **Mobile SDK**, insert the **JWT URL**. The URL must have the following format:

`https://{your-Back-Office-URL}/api/v2/my/helpdesk/zendesk/auth/mobile/exchange`

Make sure to replace `{your-Back-Office-URL}` with the domain of your B2CORE Back Office.

<figure><img src="https://514898401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGoRxAprhHu1goANW7FXt%2Fuploads%2Fgit-blob-c92b7fd37c3d75fdc526e176c1c2d18894881ff1%2Fzd-mobile-sdk.png?alt=media" alt="Mobile SDK settings in Zendesk"><figcaption><p>Mobile SDK settings in Zendesk</p></figcaption></figure>
{% endstep %}

{% step %}
Once the necessary settings are specified in the B2CORE Back Office, select **Yes** in the **Enabled** dropdown.
{% endstep %}

{% step %}
Click **Save** to apply the changes.
{% endstep %}
{% endstepper %}

If you previously used **SupportPal** as your help desk platform, refer to [How to switch from SupportPal to Zendesk](https://docs.b2core.b2broker.com/how-to-articles/manage-system-settings/how-to-switch-from-supportpal-to-zendesk) to make sure that your clients submit new tickets only through Zendesk but can still view their SupportPal ticket history.

## How to configure the Zendesk chatbot

To use the Zendesk chatbot in B2CORE, you need to configure the widget and authentication settings in your Zendesk account. The chatbot will be displayed in the B2CORE UI, allowing clients to ask questions, quickly find the information that they need, report issues, and seamlessly switch to a live operator, all without requiring additional authentication.

To set up the chatbot widget and generate the required credentials:

{% stepper %}
{% step %}
In Zendesk Admin Center, navigate to **Channels** > **Messaging and social** > **Messaging**.
{% endstep %}

{% step %}
Add a web widget.
{% endstep %}

{% step %}
Copy the widget code snippet to get the **Widget Key**, which is the UUID-style identifier. The key will be required when configuring the widget settings in the B2CORE Back Office.
{% endstep %}

{% step %}
To set up automatic authentication for clients interacting with the chatbot, navigate to **Account** > **Security** > **End user authentication**.
{% endstep %}

{% step %}
On the **Messaging** tab, click **Create key**.
{% endstep %}

{% step %}
Copy the values from the **Messaging Auth ID** and **Messaging Auth Shared Secret** fields. These values will be required when configuring the widget settings in the B2CORE Back Office.
{% endstep %}
{% endstepper %}

## How to configure chatbot settings in the B2CORE Back Office

After configuring the chatbot in Zendesk, proceed with the respective settings in the B2CORE Back Office to enable the bot in the B2CORE UI:

{% stepper %}
{% step %}
In the B2CORE Back Office, navigate to **System** > **External connections**.
{% endstep %}

{% step %}
Find the existing Zendesk connection in the list and click **Edit**.
{% endstep %}

{% step %}
On the **Edit connection** page, fill in the following fields:

#### Widget Settings

* In the **Enable Widget on WEB** dropdown, select **Yes** to enable displaying the chatbot in the B2CORE UI and mobile app.
* In the **Widget ID** field, enter the **Widget Key** you copied from Zendesk.
* In the **Widget Auth Key ID** field, enter the **Messaging Auth ID** retrieved from Zendesk.
* In the **Widget Auth Key Secret** field, enter the **Messaging Auth Shared Secret** retrieved from Zendesk.
  {% endstep %}

{% step %}
Click **Save** to apply the changes.
{% endstep %}
{% endstepper %}

The Zendesk chatbot is now displayed in the B2CORE UI, enabling clients to quickly access support and resolve their questions.
