Skip to main content
Skip table of contents

View event and reaction

To view an event and reaction.

GET/api/v1/scripts/{script}

Headers

Authorization

Bearer token

Accept

application/json

X-Client

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

X-UUID

unique device id

Body

scriptoptional

int

Unique identifier of the event and reaction

Response

200

Returns an object of the event and reaction

JSON
{
    "id": 1,
    "title": "script",
    "schedule": [],
    "timetable": {
        "days": [
            {
                "to": "23:59:00+05:00",
                "from": "00:00:00+05:00",
                "type": "same_every_day",
                "breaks": [
                    {
                        "to": "17:00:00+05:00",
                        "from": "16:00:00+05:00"
                    }
                ]
            }
        ],
        "intervals": []
    },
    "status": "active",
    "created_at": "2022-04-08 10:30:11",
    "updated_at": "2022-04-08 10:30:11",
    "users": [
        {
            "id": 1,
            "login": "user@mail.com",
            "name": "User name",
            "parent_id": 3,
            "permissions": [
                {
                    "id": 240,
                    "name": "inner_key_name",
                    "display_name": "Permission name for user"
                }
            ],
            "created_at": "2021-05-27 15:47:57",
            "updated_at": "2022-02-10 12:34:50",
            "online_request_interval": 100,
            "access_token_id": "3zsdfqc32323fbc38cc98e7b",
            "can_update_password": true
        }
    ],
    "event": {
        "id": 1,
        "name": "inner_key_name",
        "description": "Event name",
        "color": "#07D4F0",
        "analytic_type": "analytic_type"
    },
    "reaction": {
        "id": 1,
        "name": "inner_key_name",
        "description": "Event name",
        "is_default": false
    },
    "extra": {
        "chat_id": "chat_id",
        "bot_token": "bot_token"
    }
}
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 GET 'https://vms.local/api/v1/scripts/{script}' \
--header 'Authorization:Bearer token' \
--header 'Accept:application/json' \
--header 'X-Client:ios-cctv|android-cctv|thick-legal|web' \
--header 'X-UUID:unique device id'
JavaScript errors detected

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

If this problem persists, please contact our support.