Chatbot Overview
Conversational Bots
Intents & Entities
Intelligent Bots
Kore.ai's Approach
Kore.ai Conversational Platform
Bot Concepts and Terminology
Natural Language Processing (NLP)
Bot Types
Bot Tasks
Starting with Kore.ai Platform
How to Access Bot Builder
Working with Kore.ai Bot Builder
Building your first Bot
Getting Started with Building Bots
Using the Dialog Builder Tool
Creating a Simple Bot
Release Notes
Latest Updates
Older Releases
Bot Builder
Creating a Bot
Design
Develop
Storyboard
Dialog Task
User Intent Node
Dialog Node
Entity Node
Supported Entity Types
Composite Entities
Supported Time Zones
Supported Colors
Supported Company Names
Message Nodes
Confirmation Nodes
Service Node
Custom Authentication
2-way SSL for Service nodes
Script Node
Agent Transfer Node
WebHook Node
Connections & Transitions
Managing Dialogs
Prompt Editor
Alert Tasks
Alert Tasks
Ignore Words and Field Memory
Digital Views
Knowledge Graph
Terminology
Building
Generation
Importing and Exporting
Analysis
Knowledge Extraction
Small Talk
Action & Information Task
Action Tasks
Information Tasks
Establishing Flows
Natural Language
Overview
Machine Learning
ML Model
Fundamental Meaning
NLP Settings and Guidelines
Knowledge Graph Training
Traits
Ranking and Resolver
NLP Detection
Bot Intelligence
Overview
Context Management
Session and Context Variables
Context Object
Dialog Management
Sub-Intents
Amend Entity
Multi-Intent Detection
Sentiment Management
Tone Analysis
Sentiment Management
Default Conversations
Default Standard Responses
Channel Enablement
Test & Debug
Talk to Bot
Utterance Testing
Batch Testing
Record Conversations
Publishing your Bot
Analyzing your Bot
Overview
Dashboard
Custom Dashboard
Conversation Flows
Bot Metrics
Advanced Topics
Bot Authorization
Language Management
Collaborative Development
IVR Integration
koreUtil Libraries
Universal Bots
Defining
Creating
Customizing
Enabling Languages
Smart Bots
Defining
Sample Bots
Github
Asana
Travel Planning
Flight Search
Event Based Bot Actions
Bot Settings
Bot Functions
General Settings
PII Settings
Customizing Error Messages
Bot Management
Using Bot Variables
API Guide
API Overview
API List
API Collection
SDKs
SDK Overview
SDK Security
SDK App Registration
Web SDK Tutorial
Message Formatting and Templates
Mobile SDK Push Notification
Widget SDK Tutorial
Widget SDK – Message Formatting and Templates
Web Socket Connect & RTM
Using the BotKit SDK
Installing
Configuring
Events
Functions
BotKit SDK Tutorial – Agent Transfer
BotKit SDK Tutorial – Flight Search Sample Bot
Using an External NLP Engine
Bot Administration
Bots Admin Console
Dashboard
User Management
Managing Users
Managing Groups
Managing Role
Bots Management
Enrollment
Inviting Users
Bulk Invites
Importing Users
Synchronizing Users from AD
Security & Compliance
Using Single Sign-On
Security Settings
Cloud Connector
Analytics
Billing
How Tos
Creating a Simple Bot
Creating a Banking Bot
Transfer Funds Task
Update Balance Task
Context Switching
Using Traits
Schedule a Smart Alert
Configuring Digital Views
Custom Dashboard
Custom Tags to filter Bot Metrics
Patterns for Intents & Entities
Build Knowledge Graph
Global Variables
Content Variables
Using Bot Functions
Configure Agent Transfer
  1. Home
  2. Docs
  3. Bots
  4. API Guide
  5. Sessions History API

Sessions History API

This API retrieves the conversation sessions created. This API is available in BT and BAC app scopes.

To use this API, app needs the Bot Builder API scope of Bot sessions.
OR the Admin API Scope of Bot sessions under Bot Analytics.

POST https://{{host}}/api/public/bot/{{BotID}}/getSessions
and https://{{host}}/api/public/getSessions for Bot Admin Console

Parameters

Parameter Description
userId (optional) The ID of the user whose conversation history to access. Can be user email id or enterprise assigned unique id.
skip/offset (optional) The number of messages to be skipped.
limit (optional) The number of messages to be shown on each page.
dateFrom (optional) Takes the date format yyyy-mm-dd
(or) yyyy-mm-ddThh:mm:ss.msZ
eg:2019-04-01 (or) 2019-04-01T13:25:58.515ZIf not provided, calculated as 7 days behind dataTo.
dateTo (optional) Takes the date format yyyy-mm-dd
(or) yyyy-mm-ddThh:mm:ss.msZ
eg:2019-04-01 (or) 2019-04-01 T13:26:05.598ZIf not provided, calculated as 7 days from dateFrom. If dateFrom is also not provided then set to Today.
tags (optional) Meta tags to filter the conversations.

Note: The duration between dateTo and dateFrom should be less than 7 days, else an error will be thrown.

Authorization

Invoke the API with JWT in the header with the following syntax:
auth: {{JWT}}

Response content type

application/JSON

Sample Request

  • Without a body
    curl --location --request POST '{{host}}/api/public/getSessions' \
         --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
         --header 'Content-Type: application/json' \
         --data-raw ''
  • With a body
    curl --location --request POST '{{host}}/api/public/getSessions' \
         --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
         --header 'Content-Type: application/json' \
         --data-raw '{
            "skip" : 0,                          
            "limit" : 100,                      
            "dateFrom" : "2020-02-11",
            "dateTo" : "2020-02-12"
     }'
  • For Specific Bot
    curl --location --request POST '{{host}}/api/public/bot/{{BotId}}/getSessions' \
         --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
         --header 'Content-Type: application/json' \
         --data-raw '{
            "skip" : 0,                          
            "limit" : 100,                      
            "dateFrom" : "2020-02-11",
            "dateTo" : "2020-02-12"
     }'

Sample Response

{
    "total": 2,
    "moreAvailable": false,
    "sessions": [
          {
            "sessionId": "5e43acb58c8ae94f1250e014",
            "botId": "st-c68c3e8f-c88e-541c-bd3b-a624f3e113f7",
            "channel": "rtm",
            "userId": "u-b7a2c3ff-efde-59f0-a95f-ee02d1f4c231",
            "start_time": "2020-02-12T07:43:49.041Z",
            "end_time": "2020-02-12T09:10:49.082Z",
            "session_lang": [
                "en"
            ],
            "tags": {
                "userTags": [],
                "sessionTags": []
            }
        },
        {
            "sessionId": "5e43a73582f2844d4edbacbd",
            "botId": "st-fb172f53-31db-51b2-a5b2-4ef1919daed9",
            "channel": "ivrVoice",
            "userId": "u-c9d0de82-a459-574b-b64c-4ef3b22ec59c",
            "start_time": "2020-02-12T07:20:21.105Z",
            "end_time": "2020-02-12T07:20:22.073Z",
            "session_lang": [
                "en"
            ],
            "tags": {
                "userTags": [],
                "sessionTags": []
            }
        }
   ]
}
Menu