Categories
Good to know: Are you working with MinimalConfig? The system will then add locations and categories automatically. You can skip this steps.
Note: Always check that the hardware and software are suitable before creating locations and categories. For the API methods, see version checks.
In practice, users often assign alarms to different call lists or service groups. Therefore, you typically create multiple categories to organise these assignments.
Description of API elements
| 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 a specific call list or service group to a category via the REST API. We recommend you use call_list_id 1 when creating a category.
Good to know: If you create specific call lists or service groups in the dialler, you can link them to a category.
- How toe create a call list or service group.
- How to link a call list to an input (category).
API methods
In the scenario of the practical example, 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"
}
After you have created the locations and categories, you can use the REST API for alarming. You can read more about the alarming process in Alarm reporting.