> For the complete documentation index, see [llms.txt](https://docs-en.dydu.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-en.dydu.ai/developers/api-reference/access-to-apis.md).

# Access to APIS

The **Preferences > Api > API access** page gathers the information you need to call the APIs of your bot. It is reserved for administrators.

It displays:

* your **bot identifier** (botUUID), required by most APIs;
* your **account identifier** (accountUUID), required in particular to [import a knowledge base](https://docs-en.dydu.ai/developers/api-reference/import-export-knowledge-base#import-a-knowledge-base);
* an **authentication token**;
* the **link to the Swagger interface**, where you can browse and test the APIs.

To build the `Authorization` header yourself, see [Authentication](https://docs-en.dydu.ai/developers/api-reference/authentication).

## Swagger interface

Click the link displayed on the **API access** page to open the Swagger interface. The APIs are grouped by category. To test an API:

1. Click the category, then the API.
2. Click **Try it out**.
3. Fill in the fields, including **Authorization** (see [Authentication](https://docs-en.dydu.ai/developers/api-reference/authentication)).
4. Click **Execute**.

### Available categories

| Category                             | What it is for                                                                                                                                                |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Account**                          | Get the list of bots a user can access, and get an authentication token (`POST /authentication/token`).                                                       |
| **Account preferences**              | View, add or delete the preferences of a user account.                                                                                                        |
| **Bot data transfer**                | Export and import a whole bot or its image gallery. See [Import Export Bot](https://docs-en.dydu.ai/developers/api-reference/import-export-bot).              |
| **Bot dialogs**                      | Export dialogs, view or delete the summary of a dialog, manage tickets.                                                                                       |
| **Bot knowledge base**               | Export, import or delete a knowledge base. See [Import/Export Knowledge Base](https://docs-en.dydu.ai/developers/api-reference/import-export-knowledge-base). |
| **Bot log explicit**                 | Manage logs.                                                                                                                                                  |
| **Bot matching groups**              | Get the matching groups of the bot.                                                                                                                           |
| **Bot OIDC filters**                 | Manage the OIDC filters of the bot.                                                                                                                           |
| **Bot preferences**                  | View, add or delete the preferences of the bot. See Change a bot preference.                                                                                  |
| **Bot surveys**                      | Manage surveys (creation, retrieval…).                                                                                                                        |
| **Chat**                             | Run dialogs with the bot. See [Dialog API](https://docs-en.dydu.ai/developers/api-reference/dialog-api).                                                      |
| **Chatboxes Saml2 service provider** | Manage SAML authentication for chatboxes.                                                                                                                     |
| **Dialogs Bot preferences**          | Manage the bot preferences related to dialogs.                                                                                                                |
| **External Livechat**                | Disconnect a dialog from an external livechat.                                                                                                                |
| **Livechat competencies**            | Manage livechat competencies (add a competency to an account, delete…).                                                                                       |
| **Livechat operators availability**  | Get the availability of operators.                                                                                                                            |
| **LLM**                              | Manage the LLM features of the bot.                                                                                                                           |
| **SAML**                             | Synchronize the SAML configuration.                                                                                                                           |
| **Server BO users**                  | Change the type of an existing account (Admin, Linguist, None, All) or delete an account.                                                                     |
| **Server status**                    | Get the server status. See [Server Status API](https://docs-en.dydu.ai/developers/api-reference/server-status-api).                                           |
| **Server Who am I**                  | Get the information received by the server for your request.                                                                                                  |

{% hint style="info" %}
The **Livechat** categories are only displayed when the livechat is enabled.
{% endhint %}

## Change a bot preference

Some settings are not available in the BMS screens: you set them by adding or changing a bot preference.

1. Go to **Preferences > Api > API access** and click the link provided.
2. Click **Bot preferences**.
3. Click **PUT /preferences/bot/{botUUID}/{name}/{value}**, then **Try it out**.
4. Fill in the fields:
   * **botUUID**: your bot identifier;
   * **name**: name of the preference (see the table below);
   * **value**: value of the preference;
   * **Authorization**: your token.
5. Click **Execute**.

| Preference (name)                 | Value                             | Effect                                                                                                                         |
| --------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `chatbox.auth.saml.menu.enabled`  | `true`                            | Displays the SAML menu. SAML authentication must then be configured: see [SAML 2](https://docs-en.dydu.ai/preferences/saml-2). |
| `livechat.createmonitoreddialogs` | `true`                            | Enables monitored dialogs.                                                                                                     |
| `bot.servicename`                 | Name of your service              | Replaces "dydu" with the name of your service in the emails sent by the bot, including the GDPR email.                         |
| `bot.no.group.uuid`               | UUID of the **No** matching group | Lets the bot use the **No** group of the social bot. See below.                                                                |

{% hint style="info" %}
To view a preference, use **GET /preferences/bot/{botUUID}/{name}**. The search is partial: the name "hello" also returns the "helloWorld" preference.
{% endhint %}

### Use the No matching group of the social bot

In most cases, this configuration is not needed.

The **No** matching group of the social bot is used to handle the confirmation when the user wants to leave a **Slot** knowledge, or not. Without it, your bot may leave the **Slot** knowledge although the user did not want to.

1. Go to **Contents > Matching groups**.
2. Click the **Social** group to expand the groups, then click the **No** group.
3. Click **Dependencies**.
4. Get the UUID from the URL: it is the string of numbers and letters after **group=**.

> Example: for the URL "<https://app1.earth.doyoudreamup.com/website/knowledges/groupgraph?group=12345a67-bc89-12d3-4efg-hi56789123j0>", the UUID is "12345a67-bc89-12d3-4efg-hi56789123j0".

5. Follow the [Change a bot preference](#change-a-bot-preference) procedure with **name**: `bot.no.group.uuid` and **value**: the UUID from step 4.
