Categories
In practice, people often divide alarms between different call lists/service groups. That is why you create multiple categories.
API elements with their description
Element | Description |
---|---|
auto_repeat_delay | Delay before an alarm repeats |
auto_repeat_times | Number of repetitions after 1st alarm acceptance |
buzzer | Enabling or disabling the buzzer for this alarm |
call_list_id | ID of the selected call list / service group |
category_id | Unique generated ID for the category |
continue_after_restore | Enabling or disabling forwarding to the call list/service group after the alarm has been restored |
critical | Enabling or disabling the maximum app volume |
disabled_until | Switch off alarm to UTC time stamp YYYY-MM-DDTHH:MM:SSZ. |
enabled | Enable or disable alarm notification for this category |
location_cat_seq | Category sequence number based on location |
location_custom_id | Unique location ID defined by the customer; may be used instead of location_id |
location_id | Unique generated ID for the location |
name | Name for the category |
report_during_daytime | Enabling or disabling daytime alarm notification |
report_during_nighttime | Enabling or disabling nighttime alarm notification |
report_during_weekend | Enabling or disabling weekend alarm notification |
topic | Unique custom ID for the category |
Note: you cannot link specific call lists/service groups to a category via the REST API. We recommend using call_list_id 1 when creating a category.
Good to know: by creating specific call lists/service groups in the dialler, you can then link them to a category.
1. Learn how to create a call list/service group
2. Read how to link a call list to an entry (category)
API methods
In the situation diagram, there are 4 categories: Crop urgent, Crop non-urgent, Technically urgent and Technically non-urgent. To add categories, use the API "POST: /Categories".
"POST: /Categories"
{
"auto_repeat_delay": 300,
"auto_repeat_times": 3,
"buzzer": true,
"call_list_id": 1,
"continue_after_restore": false,
"critical": true,
"enabled": true,
"location_custom_id": "loc_01",
"name": "Cult. Urgent",
"report_during_daytime": true,
"report_during_nighttime": true,
"report_during_weekend": true,
"topic": "cultivation_urg"
}
cURL code:
curl -X 'POST' \
'http://192.168.10.72/rest_api/1/Categories' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTI1MzQ0ODgsIm5iZiI6MTYxMjUzNDQ4OCwianRpIjoiNjY0NzI2NzAtYTRkMi00N2ZmLWFiMjUtNzAyMGYwOTkwNWJhIiwiZXhwIjoxNjEyNTM3OTg4LCJpZGVudGl0eSI6IlJFU1QtQVBJXzAwMDUiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MiLCJ1c2VyX2NsYWltcyI6eyJ1c2VyX2lkIjo1LCJyb2xlX2lkIjo1LCJsYW5ndWFnZSI6Im5sLU5MIn19.6xlCrMjNsKd9Eyq5ieS-MScZe6P1idstMCKPs5dfOd8' \
-H 'Content-Type: application/json' \
-d '{
"auto_repeat_delay": 300,
"auto_repeat_times": 3,
"buzzer": true,
"call_list_id": 1,
"continue_after_restore": false,
"critical": true,
"enabled": true,
"location_custom_id": "loc_01",
"name": "Cult. Urgent",
"report_during_daytime": true,
"report_during_nighttime": true,
"report_during_weekend": true,
"topic": "cultivation_urg"
}'
Response:
{
"id": 35,
"location_id": 3,
"topic": "cultivation_urg",
"enabled": true,
"name": "Cult. Urgent",
"report_during_daytime": true,
"report_during_nighttime": true,
"report_during_weekend": true,
"continue_after_restore": false,
"call_list_id": 1,
"auto_repeat_times": 3,
"auto_repeat_delay": 300,
"buzzer": true,
"critical": true,
"location_custom_id": "loc_01"
}