GET
/
backend
/
reports
/
{orgId}
/
chats
/
availability

Authentication

Authorization
string
required

Bearer token for authentication

Path Parameters

orgId
string
required

The ID of the organization to retrieve chat availability for

Query Parameters

startDate
string
required

The start date for the report period (ISO 8601 format)

endDate
string
required

The end date for the report period (ISO 8601 format)

channel
string

The specific channel to filter results (if applicable)

Response

availability_percentage
number

The availability percentage as a number between 0 and 100

down_times
array

An array of objects representing periods of downtime

down_times[].start_time
string

The start time of the downtime period (ISO 8601 format)

down_times[].end_time
string

The end time of the downtime period (ISO 8601 format)

down_times[].duration
number

The duration of the downtime period in milliseconds

down_times[].session_id
string

The session ID associated with the downtime period

total_down_time
number

The total downtime in milliseconds for the specified period

total_time
number

The total time in milliseconds for the specified period

Calculation Method

The chat availability is calculated using the following method:

  1. Message Gap Analysis: The system analyzes the time gaps between consecutive messages within the specified date range.

  2. Downtime Threshold: A gap of more than 2 minutes between messages is considered as potential downtime.

  3. Downtime Calculation: For each gap exceeding 2 minutes, the downtime is calculated as:

    Downtime = (Time between messages) - 2 minutes
    
  4. Total Downtime: The system sums up all individual downtimes to get the total downtime.

  5. Availability Percentage: The availability percentage is calculated as:

    Availability % = ((Total Time - Total Downtime) / Total Time) * 100
    

    Where Total Time is the duration between the specified start and end dates.

Was this page helpful?