Skip to main content

Request counts per interval

Access the number of user requests (messages) per interval (i.e per day) by executing:

query LogRequestsIntervalV2(
$deskIds: _uuid
$brainIds: _uuid
$integrationIds: _uuid
$brainVersions: _int4
$channels: _text
$startDate: timestamp
$endDate: timestamp
$intervalInDays: interval
$isTest: Boolean
) {
rows: log_requests_interval_counts_v2(
args: {
interval_span: $intervalInDays
start_time: $startDate
end_time: $endDate
brain_parent_ids: $brainIds
desk_ids: $deskIds
integration_ids: $integrationIds
brain_versions: $brainVersions
channels: $channels
is_test: $isTest
}
) {
counts: interval_counts
date: per_interval
}
}

Below are some examples of how LogRequestsIntervalV2 can be called.

{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2022-04-08",
"endDate": "2022-04-17",
"intervalInDays": "1 day"
}

Example Result

{
"data": {
"rows": [
{
"counts": 1,
"date": "2022-03-14T00:00:00"
},
{
"counts": 6,
"date": "2022-04-18T00:00:00"
},
{
"counts": 21,
"date": "2022-03-22T00:00:00"
},
{
"counts": 8,
"date": "2022-04-04T00:00:00"
},
{
"counts": 3,
"date": "2022-03-21T00:00:00"
},
{
"counts": 13,
"date": "2022-03-31T00:00:00"
},
{
"counts": 10,
"date": "2022-04-01T00:00:00"
},
{
"counts": 22,
"date": "2022-03-15T00:00:00"
},
{
"counts": 7,
"date": "2022-03-18T00:00:00"
}
]