Skip to main content
Skip table of contents

Get the chart of events for people counting

Get the list of people counting events

View a list of people counting events in an area. The response will be given depending on the type of chart they want to receive.

GET /api/v1/analytic-case/{case}/person-counting/chart

Parameters

int case, Unique identifier of the analytics case


str chart, line - line graph

bar - bar graph


string date, Template for filtering by date.


array cameras, Array of camera ids for which events will be displayed


string timezone, Time zone for the date filter template.


string from, Date from which filtering will be carried out.


string to, Date until which filtering will be carried out.

200 OK

Returns a list of data for constructing a line graph

JSON
{
    "labels": [
        "2022-04-07 10:00",
        "2022-04-07 10:30",
        "2022-04-07 12:40",
        "2022-04-07 13:00",
        "2022-04-07 14:10",
        "2022-04-07 14:20"
    ],
    "datasets": [
        {
            "label": "min",
            "data": [
                1,
                1,
                1,
                1,
                1,
                1
            ]
        },
        {
            "label": "average",
            "data": [
                1,
                1,
                1,
                1,
                1,
                1
            ]
        },
        {
            "label": "max",
            "data": [
                1,
                1,
                1,
                1,
                1,
                1
            ]
        }
    ]
}

200 OK

Returns a list of data for constructing a bar chart

JSON
{
    "labels": [
        "2022-04-06 14:00",
        "2022-04-06 16:00",
        "2022-04-06 17:00",
        "2022-04-06 18:00",
        "2022-04-06 20:00",
        "2022-04-07 10:00",
        "2022-04-07 12:00",
        "2022-04-07 13:00",
        "2022-04-07 14:00"
    ],
    "datasets": [
        {
            "label": "Kitchen",
            "data": [
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1
            ],
            "backgroundColor": "#647483"
        }
    ]
}

401 Unauthorized

Authorization token not sent or not valid

422 Unprocessable Entity

Returns a JSON object with an error.

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The cause of the error will be described here"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/v1/analytic-case/{case}/person-counting/chart' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "case": 0,
    "chart": "str",
    "date": "string",
    "cameras": [],
    "timezone": "string",
    "from": "string",
    "to": "string"
}'
PHP
PHP
$data = array (
  'case' => 0,
  'chart' => 'str',
  'date' => 'string',
  'cameras' => 
  array (
  ),
  'timezone' => 'string',
  'from' => 'string',
  'to' => 'string',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'GET',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/analytic-case/{case}/person-counting/chart', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.