Creating an event and reaction
Creating an event and reaction. Users can create specific events and reactions and add them to analytic cases. When the analytics is triggered by an event, the specified reaction will be executed.
POST/api/v1/scriptsHeaders | |||||||||
Authorization | Bearer token | ||||||||
Accept | application/json | ||||||||
X-Client | ios-cctv|android-cctv|thick-legal|web | ||||||||
X-UUID | unique device id |
Body | |||||||||
json |
JSON
| ||||||||
titlerequired | string | Event and reaction name | |||||||
reaction_idrequired | int | Reaction ID. The value is taken from the statistics, see Basic Configurations | |||||||
event_idrequired | int | Event ID. The value is taken from the statistics, see Basic Configurations | |||||||
usersrequired | array | Array of user IDs to whom the reaction will be sent. Sub-users will receive reactions: show-camera-sidebar, sound, show-camera | |||||||
statusrequired | array | Event and reaction status. If it is disabled (false), the events will not be processed | |||||||
timetablerequired | array | Event and reaction working time | |||||||
timetable.daysrequired | array | Event and reaction schedule | |||||||
timetable.days.*.typerequired | string | Event and reaction schedule within a single day | |||||||
timetable.days.*.fromrequired | string | Start time of the event and reaction | |||||||
timetable.days.*.torequired | string | End time of the event and reaction | |||||||
timetable.days.*.breaksrequired | array | Time pauses during the event and reaction | |||||||
timetable.days.*.breaks.*.fromrequired | string | Start time of the event and reaction pause | |||||||
timetable.days.*.breaks.*.torequired | string | End time of the event and reaction pause | |||||||
timetable.intervalsrequired | array | Working schedule based on time intervals of the event and reaction | |||||||
timetable.intervals.*.fromrequired | string | Start date and time of the event and reaction | |||||||
timetable.intervals.*.torequired | string | End date and time of the event and reaction | |||||||
extrarequired | array | Data for creating an event and reaction with the «telegram-message» reaction type | |||||||
extra.bot_tokenrequired | str | Telegram bot token | |||||||
extra.chat_idrequired | str | Telegram chat ID |
Response | |||||||||
201 | Returns the event and reaction object | ||||||||
JSON
| |||||||||
401 | Authorization token not provided or invalid, see Obtaining a token | ||||||||
422 | Returns a JSON object with an error, see Validation | ||||||||
JSON
|
Example | |||||||||
JSON
|