Skip to main content
Skip table of contents

List of events and reactions

Pagination list of all events and reactions available to the user

GET/api/v1/scripts

Headers

Authorization

Bearer token

Accept

application/json

X-Client

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

X-UUID

unique device id

Body

pagerequired

int

Pagination page number

per_pagerequired

int

Number of items per pagination page. Default is 25

searchrequired

int

Search by name, analytics case name

excluderequired

array

Array of event and reaction IDs to exclude. Excluded IDs will not be reflected in the output

reactionsrequired

array

Search by reaction type

eventsrequired

array

Search by event type

case_typerequired

str

Search by analytics case type

Response

200

Returns a list of events and reactions on page i of the pagination

JSON
{
    "data": [
        {
            "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"
            }
        }
    ],
    "links": {
        "first": "https://vms.local/api/v1/scripts?page=1",
        "last": "https://vms.local/api/v1/scripts?page=6",
        "prev": null,
        "next": "https://vms.local/api/v1/scripts?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "pagination.previous",
                "active": false
            }
        ],
        "path": "https://vms.local/api/v1/scripts",
        "per_page": 25,
        "to": 25,
        "total": 1
    }
}
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?page=int&per_page=int&search=int&exclude=array&reactions=array&events=array&case_type=str' \
--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.