Query Parameters
Sample Request
Sample POST Method Request for the App Builder API Scope
Use the POST method to set filters, then use the following GET method to retrieve the billing session summary.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| Field | Value |
|---|---|
| Method | POST and GET |
| Endpoint | POST: For Dialog Builder: https://{{host}}/api/public/bot/{{BotID}}/billingsessionsummary For BAC: https://{{host}}/api/public/billingsessionsummary Important: First, use the POST method to set filters, then use the following GET method to retrieve the billing session summary. GET: For Dialog Builder: https://{{host}}/api/public/bot/{{BotID}}/billingsessionsummary/status?type=summary For BAC: https://{{host}}/api/public/billingsessionsummary/status?type=summary |
| Content Type | application/json |
| Authorization | auth: {{JWT}} See How to generate the JWT Token. |
| API Scope | Dialog Builder: Billing Sessions; Admin Console: Billing > Usage > Billing Sessions |
| Parameter | Description |
|---|---|
host | Environment URL, for example, https://platform.kore.ai. |
BotID (when using with Dialog Builder scope) | Bot ID or Stream ID. You can access it from the App Settings page. |
curl --location 'https://{{HOST}}/api/public/bot/{{botId}}/billingsessionsummary'\
--header 'auth: {{Auth Token}}' \
--header 'content-type: application/json' \
--data-raw '{
"fromDate": "2023-04-07T10:10:54.680Z",
"toDate": "2023-04-09T10:10:54.680Z",
"unitType": ["request","session","alert","proactive","conversations"],
"groupByBot": "no",
"groupByPeriod": "date_day_hour"
}'
curl --location 'https://{{HOST}}/api/public/bot/{{botId}}/billingsessionsummary/status?type=summary'\
--header 'auth: {{Auth Token}}' \
--header 'content-type: application/json'
curl --location 'https://{{HOST}}/api/public/bots/billingsessionsummary' \
--header 'auth: {{Auth Token}}' \
--header 'content-type: application/json' \
--data-raw '{
"fromDate": "2022-09-01T07:18:54.089Z",
"toDate": "2022-09-07T23:30:25.931Z",
"unitType": ["session","request","alert","proactive", "conversations"],
"groupByBot": "yes",
"streamIds": ["st-13d7a88d-83cb-52bb-b847-ed32cxxxxxxx"],
"groupByPeriod": "date_month"
}'
curl --location 'https://{{HOST}}/api/public/bots/billingsessionsummary/status?type=summary'\
--header 'auth: {{Auth Token}}' \
--header 'content-type: application/json'
| Parameter | Required/Optional | Description |
|---|---|---|
fromDate | date, required | Accepts the date in yyyy-mm-dd format or yyyy-mm-ddThh:mm:ss.msZ. Max: 90 days. |
toDate | date, required | Accepts the date in yyyy-mm-dd format or yyyy-mm-ddThh:mm:ss.msZ. Max: 90 days. |
unitType | string, required | The unit type of the billing session. Possible values: session, request, alert, proactive, conversations. |
groupByApp | string, required | Groups billing sessions by Apps. Use yes for BAC scope with stream ID, no for Dialog Builder scope without stream ID. |
groupByPeriod | string, required | Retrieve conversation session data on a Monthly, Daily, or Hourly basis. Possible values: date_day_hour, date_day, date_month. |
{
"reportId": "121242",
"status": "IN_PROGRESS",
"percentageComplete": 0,
"orgId": "o-d54e1923-94e5-5b33-b248-xxxxxxxx",
"createdBy": "u-093524cf-9df9-5371-b28b-xxxxxxxxx",
"jobType": "BILLINGSESSIONS_API",
"action": "QUERY",
"statusLogs": [],
"_id": "ds-d7d23763-b876-5219-b93e-6398ea4cb1ec",
"lMod": "2023-04-27T06:19:11.000Z",
"createdOn": "2023-04-27T06:19:11.034Z",
"__v": 0
}
{
"_id": "ds-df7dbe18-9028-59db-8d12-cda96xxxxxx",
"status": "success",
"response": {
"data": [{
"bot": "ALL",
"val": [{
"date": "2023-04-01T00:00:00.000Z",
"val": {
"requests": 0,
"sessions": 0,
"alert_notifications": 57,
"proactive_notifications": 10,
"conversations": 3
}
}]
}],
"averageSessions": 70
}
}
Was this page helpful?