| Field | Value |
|---|---|
| Method | GET and POST |
| Endpoint | GET: https://{{host}}/api/public/bot/{{botId}}/messages-lite?userId={{userId}}&limit=5&skip=0&offset=0 POST: https://{{host}}/api/public/bot/{{botId}}/messages-lite |
| Content Type | application/json |
| Authorization | auth: {{JWT}} See How to generate the JWT Token. |
| API Scope | App Builder: Chat History; Admin Console: Bot Analytics > Chat History |
Path Parameters
| Parameter | Required | Description |
|---|---|---|
host | Required | Environment URL, for example, https://platform.kore.ai. |
botId | Required | Bot ID or Stream ID. Access it on the bot’s General Settings page. |
Sample Request
GET Method:Request Query Parameters (GET)
| Parameter | Required | Type | Description |
|---|---|---|---|
userId | Required | String | Unique identifier of the user. |
limit | Optional | Integer | Maximum number of messages to return. Default is 5. |
skip | Optional | Integer | Number of records to skip before retrieving results. |
offset | Optional | Integer | Pagination offset value. |
Request Body Parameters (POST)
| Parameter | Required | Type | Description |
|---|---|---|---|
userId | Required | String | Unique identifier of the user. |
sessionId | Optional | String | Unique session identifier. |
dateFrom | Optional | String | Start date for filtering messages. Format: YYYY-MM-DD. |
dateTo | Optional | String | End date for filtering messages. Format: YYYY-MM-DD. |
channelType | Optional | String | Source channel, for example rtm. |
type | Optional | Array | Message direction: incoming or outgoing. |
limit | Optional | Integer | Maximum number of messages to return. |
skip | Optional | Integer | Number of records to skip. |
isDeveloper | Optional | Boolean | Indicates if the query runs in developer mode. |
Sample Response
GET method:Response Body Parameters
| Parameter | Type | Description |
|---|---|---|
total | Integer | Total number of messages matching the query. |
moreAvailable | Boolean | Indicates whether more messages are available beyond the current response. |
messages | Array | Array of message objects. |
_id | String | Unique identifier of the message. |
botId | String | Unique identifier of the bot. |
type | String | Direction: incoming or outgoing. |
status | String | Message status, such as pending or received. |
createdOn | String | ISO 8601 timestamp when the message was created. |
sessionId | String | Unique session ID. |
lang | String | Language of the message. |
chnl | String | Channel through which the message was sent. |
components | Array | Array of message components. |
cT | String | Type of message component, for example text. |
data | Object | Object containing message content. |