Chats API

Create API key

Before using the API, you need to generate an API key. This can be done through the Ebbot application. Navigate to Settings > Integrations > API keys in the sidebar.

To generate a new key, click New in the top-right corner. Give your API key a name, click Save and the keys will be generated. Note that the full API key consists of both the public and the private key separated with a dot (.) and it will only be shown once, so take note while it is displayed.

When making calls to the Ebbot API, the full API key needs to be passed as a header namedx-api-key:

x-api-key: <public-key>.<secret-key>

Fetching chats and transcripts

Two API endpoints are available:

  • List Chats: Retrieves a paginated list of chats.

  • Fetch Transcript: Retrieves the full transcript for a specific chat ID.

Step 1: Retrieve a List of Chats

The URL in the following endpoints needs to be replaced with your actual Ebbot Platform URL. This is the same URL used to reach ebbot app. It can be one of the following URLs:

ebbot.eu v2.ebbot.app ca.ebbot.app

Endpoint

GET https://<ebbot_url>/api/chats/company_chats?page={page_number}&limit={limit}
  • page (optional): Page number for pagination (default is 1).

  • limit (optional): Number of chat records to retrieve per request (default is 15).

Example Request (curl)

curl --location 'https://ebbot.eu/api/chats/company_chats?page=1&limit=15' \
--header 'accept: application/json' \
--header 'x-api-key: <public-key>.<secret-key>'

Step 2: Retrieve Chat Transcript

Use chat IDs from the chat list response to retrieve detailed transcripts.

Endpoint

GET https://<ebbot-url>/api/chats/company_chats/{chatid}/transcript

Replace {chatid} with the desired chat ID.

Example Request (curl)

curl --location 'https://<ebbot-url>/api/chats/company_chats/1723454103.158.fa1419c9-2568-4ea5-9ddc-00b6c0fbd69e/transcript' \
--header 'accept: application/json' \
--header 'x-api-key: <public-key>.<secret-key>'

Example Transcript Response

{
  "success": true,
  "data": [
    {
      "date": "8/12/2024",
      "time": "9:15:08 AM",
      "sender": "bot",
      "text": "Hey"
    },
    {
      "date": "8/12/2024",
      "time": "9:15:08 AM",
      "sender": "bot",
      "text": "Hi there!"
    },
    {
      "date": "8/12/2024",
      "time": "9:15:12 AM",
      "sender": "user",
      "text": "I want to talk to human agent!"
    },
    {
      "date": "8/12/2024",
      "time": "9:15:16 AM",
      "sender": "bot",
      "text": "Sure! Let me connect you..."
    },
    {
      "date": "8/12/2024",
      "time": "9:15:19 AM",
      "sender": "system",
      "text": "The chat is now handled by an agent."
    },
    {
      "date": "8/12/2024",
      "time": "9:15:22 AM",
      "sender": "agent",
      "text": "Hello there!"
    }
  ],
  "request_id": "c61b72b1-d966-4873-ae06-7740fac5c00b"
}

Rate Limit

To ensure optimal performance and availability of the Chats API, a rate limit is enforced:

Limit: 20 requests per minute

Exceeding this limit will cause subsequent requests to time out. Please manage your request rates accordingly to avoid disruptions in service and implement handling mechanisms to pause and retry after the rate limit resets.

Last updated

Was this helpful?