Skip to main content
Skip table of contents

Analytics case update. License plate recognition

Updating an analytics case with the type «License plate recognition».

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

Headers

Authorization

Bearer token

Accept

application/json

X-Client

ios-cctv|android-cctv|thick-legal|web

X-UUID

unique device id

Body

json

JSON
{
    "title": "License plate recognition",
    "type": "license_plate",
    "cameras": [
        {
            "id": 10,
            "analytic_case_camera_user_status": null,
            "scripts": [
                {
                    "id": 29,
                    "analytic_groups": [
                        3
                    ]
                }
            ],
            "meta": {
                "figure": [
                    {
                        "x": 0.21875,
                        "y": 0.26944444444444443
                    },
                    {
                        "x": 0.384375,
                        "y": 0.825
                    },
                    {
                        "x": 0.84375,
                        "y": 0.6722222222222223
                    },
                    {
                        "x": 0.778125,
                        "y": 0.1111111111111111
                    }
                ]
            }
        },
        {
            "id": 7,
            "analytic_case_camera_user_status": null,
            "scripts": [
                {
                    "id": 29,
                    "analytic_groups": [
                        3
                    ]
                }
            ],
            "meta": {
                "figure": [
                    {
                        "x": 0.2515625,
                        "y": 0.2861111111111111
                    },
                    {
                        "x": 0.428125,
                        "y": 0.875
                    },
                    {
                        "x": 0.85625,
                        "y": 0.8277777777777777
                    },
                    {
                        "x": 0.8375,
                        "y": 0.14444444444444443
                    }
                ]
            }
        }
    ]
}

caseoptional

int

Unique identifier of the analytics case to be updated

titlerequired

string

Analytics case name

camerasrequired

array

Array of camera objects specifying the event, reaction, and analytics resource groups

cameras.*.idrequired

array

Camera ID

cameras.*.scriptsrequired

array

Array of event and reaction IDs

cameras.*.scripts.*.idrequired

int

Event and reaction ID, see Creating an event and reaction

cameras.*.scripts.*.analytic_groupsrequired

array

Array of analytics resource group IDs

cameras.*.scripts.*.analytic_groups.*required

int

Analytics resource group ID, see Create a resource group

cameras.*.metarequired

array

Meta information

cameras.*.meta.figurerequired

array

Selected area of the camera to be processed by the analytics. It is passed as an array of coordinates (bend points) in relative values from 0 to 1. The number of points can range from three to n. The last coordinate does not need to be passed; the area will be closed with the initial coordinate

cameras.*.analytic_case_camera_user_statusrequired

str

Changing the status of the case. pause - pause a specific camera of the case, unpause - resume a specific camera of the case

camerasrequired

array

Array of camera objects to be deleted, specifying the deletion type

cameras.*.idrequired

int

Camera ID

cameras.*.forcerequired

bool

Deletion type. true - delete the case completely, false - mark the case as deleted but keep the existing events. New events will not be generated

Response

200

Returns the updated analytics case

JSON
{
    "id": 54,
    "title": "License plate recognition",
    "type": "license_plate",
    "type_pretty": "License plate recognition",
    "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": "Camera 1",
            "pretty_text": "Cameras",
            "short_address": "Cameras",
            "full_address": "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": 29,
                    "title": "Set a 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 13:36:41",
                    "updated_at": "2022-12-21 13:36:41",
                    "users": [
                        {
                            "id": 5,
                            "login": "user",
                            "name": "user",
                            "parent_id": null,
                            "created_at": "2022-12-06 20:20:58",
                            "updated_at": "2022-12-21 12:57:40",
                            "access_token_id": null,
                            "can_update_password": true
                        }
                    ],
                    "event": {
                        "id": 6,
                        "name": "recognized-plate-start",
                        "description": "License plate",
                        "color": "#3EDE9B",
                        "analytic_type": "license_plate"
                    },
                    "analytic_groups": [
                        {
                            "id": 3,
                            "name": "name",
                            "type": "plate_resource",
                            "type_pretty": "License plate",
                            "uuid": "c3276706-0157-47df-a6a4-5400e77e2611",
                            "created_at": "2022-12-21 13:26:21",
                            "updated_at": "2022-12-21 13:26:21"
                        }
                    ],
                    "extra": null
                }
            ],
            "meta": {
                "figure": [
                    {
                        "x": 0.21875,
                        "y": 0.26944444444444443
                    },
                    {
                        "x": 0.384375,
                        "y": 0.825
                    },
                    {
                        "x": 0.84375,
                        "y": 0.6722222222222223
                    },
                    {
                        "x": 0.778125,
                        "y": 0.1111111111111111
                    }
                ]
            },
            "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,
            "event": null,
            "is_bridge": false,
            "is_favorite": false,
            "user_status": "active",
            "name": "Camera 1"
        },
        {
            "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": "Camera 2",
            "pretty_text": "Cameras",
            "short_address": "Cameras",
            "full_address": "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": 29,
                    "title": "Set a 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 13:36:41",
                    "updated_at": "2022-12-21 13:36:41",
                    "users": [
                        {
                            "id": 5,
                            "login": "user",
                            "name": "user",
                            "parent_id": null,
                            "created_at": "2022-12-06 20:20:58",
                            "updated_at": "2022-12-21 12:57:40",
                            "access_token_id": null,
                            "can_update_password": true
                        }
                    ],
                    "event": {
                        "id": 6,
                        "name": "recognized-plate-start",
                        "description": "License plate",
                        "color": "#3EDE9B",
                        "analytic_type": "license_plate"
                    },
                    "analytic_groups": [
                        {
                            "id": 3,
                            "name": "name",
                            "type": "plate_resource",
                            "type_pretty": "License plate",
                            "uuid": "c3276706-0157-47df-a6a4-5400e77e2611",
                            "created_at": "2022-12-21 13:26:21",
                            "updated_at": "2022-12-21 13:26:21"
                        }
                    ],
                    "extra": null
                }
            ],
            "meta": {
                "figure": [
                    {
                        "x": 0.2515625,
                        "y": 0.2861111111111111
                    },
                    {
                        "x": 0.428125,
                        "y": 0.875
                    },
                    {
                        "x": 0.85625,
                        "y": 0.8277777777777777
                    },
                    {
                        "x": 0.8375,
                        "y": 0.14444444444444443
                    }
                ]
            },
            "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,
            "event": null,
            "is_bridge": false,
            "is_favorite": false,
            "user_status": "active",
            "name": "Camera 2"
        }
    ],
    "created_at": "2022-12-21 13:37:01",
    "updated_at": "2022-12-21 13:37:01",
    "analytic_files": [
        {
            "id": 12,
            "name": "1111 TT-1",
            "type": "plate_resource",
            "type_pretty": "License plate",
            "uuid": null,
            "body": "1111TT1",
            "url": null,
            "created_at": "2022-12-21 13:25:39",
            "updated_at": "2022-12-21 13:25:39"
        }
    ],
    "color": "#00B2FF",
    "available_events": [],
    "is_fails_exists": false
}
401

Authorization token is not provided or invalid, see Obtaining a token

402

The license limit for the selected analytics case has been exceeded

422

Returns a JSON error object, see Validation

JSON
{
    "message": "There won't be any informative message here",
    "errors": {
        "any_key": [
            "Here the error cause will be described"
        ]
    }
}

Example

JSON
curl -k --location --request PUT 'https://vms.local/api/v1/analytic-case/{case}' \
--header 'Authorization:Bearer token' \
--header 'Accept:application/json' \
--header 'X-Client:ios-cctv|android-cctv|thick-legal|web' \
--header 'X-UUID:unique device id' \
--header 'Content-Type: application/json \
--data-raw '{
    "title": "License plate recognition",
    "type": "license_plate",
    "cameras": [
        {
            "id": 10,
            "analytic_case_camera_user_status": null,
            "scripts": [
                {
                    "id": 29,
                    "analytic_groups": [
                        3
                    ]
                }
            ],
            "meta": {
                "figure": [
                    {
                        "x": 0.21875,
                        "y": 0.26944444444444443
                    },
                    {
                        "x": 0.384375,
                        "y": 0.825
                    },
                    {
                        "x": 0.84375,
                        "y": 0.6722222222222223
                    },
                    {
                        "x": 0.778125,
                        "y": 0.1111111111111111
                    }
                ]
            }
        },
        {
            "id": 7,
            "analytic_case_camera_user_status": null,
            "scripts": [
                {
                    "id": 29,
                    "analytic_groups": [
                        3
                    ]
                }
            ],
            "meta": {
                "figure": [
                    {
                        "x": 0.2515625,
                        "y": 0.2861111111111111
                    },
                    {
                        "x": 0.428125,
                        "y": 0.875
                    },
                    {
                        "x": 0.85625,
                        "y": 0.8277777777777777
                    },
                    {
                        "x": 0.8375,
                        "y": 0.14444444444444443
                    }
                ]
            }
        }
    ]
}'
JavaScript errors detected

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

If this problem persists, please contact our support.