Skip to main content
Skip table of contents

Creating a resource

Resource creation. Resources can be of two types:

face_resource - Used for analytics cases with the «Face recognition» type (face)

plate_resource - Used for analytics cases with the «License plate recognition» type (license_plate)

Resources, in turn, belong to resource groups (see Create a resource group), which are then added to specific analytics cases.

POST/api/v1/analytics/files

Headers

Authorization

Bearer token

Accept

application/json

X-Client

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

X-UUID

unique device id

Body

json

JSON
{
    "name": "name",
    "image": "binary",
    "body": "1111 AA-7",
    "type": "face_resource"
}

namerequired

string

Resource name

imagerequired

binary

Resource image. Required when creating a resource of type «face_resource»

bodyrequired

string

License plate number. Required when creating a resource of type «plate_resource»

typerequired

string

Resource group type

Response

201

Returns the resource object

JSON
{
    "id": 1,
    "name": "name",
    "type": "type",
    "type_pretty": "type_pretty",
    "uuid": null,
    "body": "1111AA7",
    "url": "https://vms.local/storage/analytic-files/2022/4/8/CmICjV9h4RNgP3V9evqeNg7HTbRk0juCB0XXXXay7.jpg",
    "created_at": "2022-04-08 16:01:33",
    "updated_at": "2022-04-08 16:01:33"
}
401

Authorization token not provided or invalid, see Obtaining a token

422

Returns a JSON object with an error, 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 POST 'https://vms.local/api/v1/analytics/files' \
--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 '{
    "name": "name",
    "image": "binary",
    "body": "1111 AA-7",
    "type": "face_resource"
}'
JavaScript errors detected

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

If this problem persists, please contact our support.