Skip to content

Billing Sessions API

This API retrieves the list of individual billing sessions created for an app so that you can review them for correctness and reconciliation.

Method POST
Endpoint For Dialog Builder:

https://{{host}}/api/public/bot/{{BotID}}/getBillingSessionsDetails

For Bot Admin Console: https://{{host}}/api/public/getBillingSessionsDetails

Content Type application/json
Authorization auth: {{JWT}}

See How to generate the JWT Token.

API Scope
  • Dialog Builder: Billing Sessions
  • Bot Admin Console: Billing >Usage> Billing Sessions

Query Parameters

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.

Body Parameters

Parameter Description
fromDate Takes the date format yyyy-mm-dd

(or) yyyy-mm-ddThh:mm: ss.msZ

eg:2019-04-01 (or) 2019-04-01T13:25:58.515Z

toDate Takes the date format yyyy-mm-dd

(or) yyyy-mm-ddThh:mm:ss.msZ

eg:2019-04-01 (or) 2019-04-01T13:25:58.515Z

A maximum of three months date period is allowed

limit (optional) Number of records to be shown in the response
skip (optional) Number of records to be skipped
channel (optional) The channel code.
botId (optional when using Admin scope) Bot ID or Stream ID. You can access it from the App Settings page of the app.

Sample Request

  • For Dialog Builder API scope

    `curl --location --request POST 'https://{{HOST}}/api/public/bot/{{botId}}/getBillingSessionsDetails' \`
    --header 'auth: {{Auth Token}}' \
    --header 'content-type: application/json' \
    --data-raw '{
        "fromDate": "2021-02-21",
        "toDate": "2021-07-22",
        "limit": 100,
        "skip": 0
    }'
    

  • For Admin API scope

    `curl --location --request POST 'https://{{HOST}}/api/public/bots/getBillingSessionsDetails' \`
    --header 'auth: {{Auth Token}}' \
    --header 'content-type: application/json' \
    --data-raw '{
        "fromDate": "2021-03-21",
        "toDate": "2021-07-22",
        "limit": 100,
        "skip": 0
    }'
    

Sample Response

{
  "total":5,
  "moreAvailable": true,
  "sessions":
   [
    {
       "botId": "st-cXaaXXXe-ddXd-XXXX-XbeX-XXXXXcXdXbcX",
       "channel": "IVR",
       "koreUserId": "u-eXXXXXXX-bXfX-XXXc-XXXb-XfXaaXXXXXXX",
       "channelUserId": "XfXXXXXfXXdXcXXXfeXXXdX/ivrvoice/00000152",
       "billingSessionType": "Conversations",
       "conversationSessionId": "XXXXXXbXbXeXXbXcXXfXaXXX",
       "conversationSessionStartDateTime": "03-10-2021 2:05:03 pm",
       "conversationSessionEndDateTime": "03-10-2021 2:05:30 pm",
       "billingSessionId": "XXXXXXbXXXcXXXXcXdXXXXXf",
       "billingSessionStartDateTime": "03-10-2021 2:05:03 pm",
       "billingSessionEndDateTime": "03-10-2021 2:05:30 pm"
   },
   {
       "botId": "st-cXaaXXXe-ddXd-XXXX-XbeX-XXXXXcXdXbcX",
       "channel": "IVR",
       "koreUserId": "u-eXXXXXXX-bXfX-XXXc-XXXb-XfXaaXXXXXXX",
       "channelUserId": "XfXXXXXfXXdXcXXXfeXXXdX/ivrvoice/00000152",
       "billingSessionType": "Conversations",
       "conversationSessionId": "XXXXXXbXbXeXXbXcXXfXaXXX",
       "conversationSessionStartDateTime": "03-10-2021 2:09:02 pm",
       "conversationSessionEndDateTime": "03-10-2021 2:10:17 pm",
       "billingSessionId": "XXXXXXbXXXcXXXXcXdXXXXXf",
       "billingSessionStartDateTime": "03-10-2021 2:09:02 pm",
       "billingSessionEndDateTime": "03-10-2021 2:10:17 pm"
   },
{
       "botId": "st-cXaaXXXe-ddXd-XXXX-XbeX-XXXXXcXdXbcX",
       "channel": "IVR",
       "koreUserId": "u-eXXXXXXX-bXfX-XXXc-XXXb-XfXaaXXXXXXX",
       "channelUserId": "XfXXXXXfXXdXcXXXfeXXXdX/ivrvoice/00000152",
       "billingSessionType": "Conversations",
       "conversationSessionId": "XXXXXXbXbXeXXbXcXXfXaXXX",
       "conversationSessionStartDateTime": "03-10-2021 2:05:03 pm",
       "conversationSessionEndDateTime": "03-10-2021 2:05:30 pm",
       "billingSessionId": "XXXXXXbXXXcXXXXcXdXXXXXf",
       "billingSessionStartDateTime": "03-10-2021 2:05:03 pm",
       "billingSessionEndDateTime": "03-10-2021 2:05:30 pm"
   },
  {
       "botId": "st-cXaaXXXe-ddXd-XXXX-XbeX-XXXXXcXdXbcX",
       "channel": "IVR",
       "koreUserId": "u-eXXXXXXX-bXfX-XXXc-XXXb-XfXaaXXXXXXX",
       "channelUserId": "XfXXXXXfXXdXcXXXfeXXXdX/ivrvoice/00000152",
       "billingSessionType": "Conversations",
       "conversationSessionId": "XXXXXXbXbXeXXbXcXXfXaXXX",
       "conversationSessionStartDateTime": "03-10-2021 2:05:03 pm",
       "conversationSessionEndDateTime": "03-10-2021 2:05:30 pm",
       "billingSessionId": "XXXXXXbXXXcXXXXcXdXXXXXf",
       "billingSessionStartDateTime": "03-10-2021 2:05:03 pm",
       "billingSessionEndDateTime": "03-10-2021 2:05:30 pm"
   },
  {
       "botId": "st-cXaaXXXe-ddXd-XXXX-XbeX-XXXXXcXdXbcX",
       "channel": "IVR",
       "koreUserId": "u-eXXXXXXX-bXfX-XXXc-XXXb-XfXaaXXXXXXX",
       "channelUserId": "XfXXXXXfXXdXcXXXfeXXXdX/ivrvoice/00000152",
       "billingSessionType": "Conversations",
       "conversationSessionId": "XXXXXXbXbXeXXbXcXXfXaXXX",
       "conversationSessionStartDateTime": "03-10-2021 2:05:03 pm",
       "conversationSessionEndDateTime": "03-10-2021 2:05:30 pm",
       "billingSessionId": "XXXXXXbXXXcXXXXcXdXXXXXf",
       "billingSessionStartDateTime": "03-10-2021 2:05:03 pm",
       "billingSessionEndDateTime": "03-10-2021 2:05:30 pm"
   }
] }