Skip to main content
Skip table of contents

Update a case for people counting

Analytics case update

Updating an analytics case for the Counting people in an area type.

JSON
{
    "title": "Counting objects in an area",
    "type": "person-counting",
    "cameras": [
        {
            "id": 10,
            "analytic_case_camera_user_status": null,
            "scripts": [
                {
                    "id": 20,
                    "is_enabled": true
                }
            ],
            "meta": {
                "figures": [
                    {
                        "name": "Figure 1",
                        "coords": [
                            {
                                "x": 0.153125,
                                "y": 0.31666666666666665
                            },
                            {
                                "x": 0.3421875,
                                "y": 0.7361111111111112
                            },
                            {
                                "x": 0.86875,
                                "y": 0.6472222222222223
                            },
                            {
                                "x": 0.78125,
                                "y": 0.125
                            }
                        ]
                    }
                ],
                "reaction_after_value": 3
            }
        },
        {
            "id": 7,
            "analytic_case_camera_user_status": null,
            "scripts": [
                {
                    "id": 20,
                    "is_enabled": true
                }
            ],
            "meta": {
                "figures": [
                    {
                        "name": "Figure 1",
                        "coords": [
                            {
                                "x": 0.153125,
                                "y": 0.31666666666666665
                            },
                            {
                                "x": 0.3421875,
                                "y": 0.7361111111111112
                            },
                            {
                                "x": 0.86875,
                                "y": 0.6472222222222223
                            },
                            {
                                "x": 0.78125,
                                "y": 0.125
                            }
                        ]
                    }
                ],
                "reaction_after_value": 3
            }
        }
    ]
}

PUT /api/v1/analytic-case/{case}

Parameters

int case, Unique identifier of the analytics case to update


string title, Title of the analytics case to be updated


array cameras, Array of camera objects to be deleted, indicating the type of deletion

object array

bool

 

cameras.

 

REQUIRED

, .force Delete type.


bool

 

cameras.

 

REQUIRED

, .force Delete type.


200 OK

Returns the analytics case

JSON
{
    "id": 42,
    "title": "Counting objects in an area",
    "type": "person-counting",
    "type_pretty": "Count objects in area",
    "status": "active",
    "cameras": [
        {
            "id": 10,
            "group_id": 2,
            "status": "active",
            "type": "media_server_v2",
            "start_at": "",
            "created_at": "2022-12-16 10:25:55",
            "billing_id": null,
            "pretty_name": "manual retransfer Fence (gate top view)",
            "pretty_text": "Test cameras, manual cameras",
            "short_address": "Test cameras, manual cameras",
            "full_address": "Test cameras, manual cameras",
            "lat": null,
            "lng": null,
            "azimuth": null,
            "streams": [
                {
                    "id": 19,
                    "type": "high",
                    "camera_id": 10,
                    "is_preview_from_server": true,
                    "is_archive_from_server": null,
                    "status": "active",
                    "has_sound": false,
                    "width": null,
                    "height": null
                },
                {
                    "id": 20,
                    "type": "low",
                    "camera_id": 10,
                    "is_preview_from_server": true,
                    "is_archive_from_server": null,
                    "status": "active",
                    "has_sound": false,
                    "width": null,
                    "height": null
                }
            ],
            "has_sound": false,
            "archive_ranges": [],
            "archive_recording_timetable": null,
            "is_archive_recording": false,
            "archive_recording_type": "fulltime",
            "can_change_archive_timetable": false,
            "scripts": [
                {
                    "id": 20,
                    "is_enabled": true,
                    "title": "Set label",
                    "schedule": [],
                    "timetable": {
                        "days": [
                            {
                                "to": "23:59:00+05:00",
                                "from": "00:00:00+05:00",
                                "type": "same_every_day",
                                "breaks": []
                            }
                        ],
                        "intervals": []
                    },
                    "status": "active",
                    "created_at": "2022-12-21 12:41:39",
                    "updated_at": "2022-12-21 12:41:39",
                    "users": [
                        {
                            "id": 5,
                            "login": "170500",
                            "name": "170500",
                            "parent_id": null,
                            "created_at": "2022-12-06 20:20:58",
                            "updated_at": "2022-12-21 10:53:45",
                            "access_token_id": null,
                            "can_update_password": true
                        }
                    ],
                    "event": {
                        "id": 3,
                        "name": "person-counting",
                        "description": "Count objects in an area",
                        "color": "#FF7CF2",
                        "analytic_type": "person-counting"
                    },
                    "extra": null
                }
            ],
            "meta": {
                "figures": [
                    {
                        "name": "Figure 1",
                        "coords": [
                            {
                                "x": 0.153125,
                                "y": 0.31666666666666665
                            },
                            {
                                "x": 0.3421875,
                                "y": 0.7361111111111112
                            },
                            {
                                "x": 0.86875,
                                "y": 0.6472222222222223
                            },
                            {
                                "x": 0.78125,
                                "y": 0.125
                            }
                        ]
                    }
                ],
                "reaction_after_value": 3
            },
            "analytic_case_camera_status": "inactive",
            "analytic_case_camera_status_pretty": "Camera inactive",
            "analytic_case_camera_user_status": "failed_to_create",
            "analytic_case_camera_user_status_pretty": "Creation error",
            "analytic_notification": {
                "title": "Error reading video stream",
                "expired_at": "2024-02-15T09:22:15.192128Z"
            },
            "analytic_case_camera_uuid": "cca769c0-ea88-4e7d-88c7-6d5beb66de97",
            "event": null,
            "is_bridge": false,
            "is_favorite": false,
            "user_status": "active",
            "name": "manual retransfer Fence (gate top view)"
        },
        {
            "id": 7,
            "group_id": 2,
            "status": "inactive",
            "type": "media_server_v2",
            "start_at": "",
            "created_at": "2022-12-16 10:25:54",
            "billing_id": null,
            "pretty_name": "manual Analitika 5",
            "pretty_text": "Test cameras, manual cameras",
            "short_address": "Test cameras, manual cameras",
            "full_address": "Test cameras, manual cameras",
            "lat": null,
            "lng": null,
            "azimuth": null,
            "streams": [
                {
                    "id": 13,
                    "type": "high",
                    "camera_id": 7,
                    "is_preview_from_server": true,
                    "is_archive_from_server": null,
                    "status": "active",
                    "has_sound": false,
                    "width": null,
                    "height": null
                },
                {
                    "id": 14,
                    "type": "low",
                    "camera_id": 7,
                    "is_preview_from_server": true,
                    "is_archive_from_server": null,
                    "status": "active",
                    "has_sound": false,
                    "width": null,
                    "height": null
                }
            ],
            "has_sound": false,
            "archive_ranges": [],
            "archive_recording_timetable": null,
            "is_archive_recording": false,
            "archive_recording_type": "fulltime",
            "can_change_archive_timetable": false,
            "scripts": [
                {
                    "id": 20,
                    "is_enabled": true,
                    "title": "Set label",
                    "schedule": [],
                    "timetable": {
                        "days": [
                            {
                                "to": "23:59:00+05:00",
                                "from": "00:00:00+05:00",
                                "type": "same_every_day",
                                "breaks": []
                            }
                        ],
                        "intervals": []
                    },
                    "status": "active",
                    "created_at": "2022-12-21 12:41:39",
                    "updated_at": "2022-12-21 12:41:39",
                    "users": [
                        {
                            "id": 5,
                            "login": "170500",
                            "name": "170500",
                            "parent_id": null,
                            "created_at": "2022-12-06 20:20:58",
                            "updated_at": "2022-12-21 10:53:45",
                            "access_token_id": null,
                            "can_update_password": true
                        }
                    ],
                    "event": {
                        "id": 3,
                        "name": "person-counting",
                        "description": "Count objects in an area",
                        "color": "#FF7CF2",
                        "analytic_type": "person-counting"
                    },
                    "extra": null
                }
            ],
            "meta": {
                "figures": [
                    {
                        "name": "Figure 1",
                        "coords": [
                            {
                                "x": 0.153125,
                                "y": 0.31666666666666665
                            },
                            {
                                "x": 0.3421875,
                                "y": 0.7361111111111112
                            },
                            {
                                "x": 0.86875,
                                "y": 0.6472222222222223
                            },
                            {
                                "x": 0.78125,
                                "y": 0.125
                            }
                        ]
                    }
                ],
                "reaction_after_value": 3
            },
            "analytic_case_camera_status": "active",
            "analytic_case_camera_status_pretty": "Camera active",
            "analytic_case_camera_user_status": null,
            "analytic_case_camera_user_status_pretty": null,
            "analytic_notification": null,
            "analytic_case_camera_uuid": "cca769c0-ea88-4e7d-88c7-6d5beb66de97",
            "event": null,
            "is_bridge": false,
            "is_favorite": false,
            "user_status": "active",
            "name": "manual Analitika 5"
        }
    ],
    "created_at": "2022-12-21 12:41:54",
    "updated_at": "2022-12-21 12:41:54",
    "color": "#F027DC",
    "available_events": [],
    "is_fails_exists": true,
    "errors": [
        "Error creating camera manual retransfer Fence (gate top view)."
    ]
}

401 Unauthorized

Authorization token not sent or not valid

402 Payment Required

The license limit for the selected analytics case has been exceeded

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}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "case": 0,
    "title": "string",
    "cameras": {
        "": true
    },
    "cameras.": "void"
}'
PHP
PHP
$data = array (
  'case' => 0,
  'title' => 'string',
  'cameras' => 
  array (
    '' => true,
  ),
  'cameras.' => 'void',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PUT',
		'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}', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.