MinimalConfig
Tip: If your external device supports CRUD, use this method to communicate with the Touch Pro or ARA alarm dialler. The CRUD method allows you to configure locations and categories yourself. You can find the required APIs under Locations and Categories.
Description of API elements
| Element | Description |
|---|---|
| custom_id | You use this to set a unique location ID. |
| topic | You use this to specify a unique, self-chosen category ID. |
| name | This is the name of the category. This name appears in the logbook and on the screen. |
| name | This is the name of the location. You see this name in the alarm report (spoken or text), the logbook, and on the screen. |
Note: For MinimalConfig, only a GET and POST API are available. Would you like to modify or delete elements afterwards? Then perform a POST again with the desired data.
API Methods
In the scenario of the practical example, there are two locations: Tomatoes and Peppers.
POST: /MinimalConfig
{
"locations": [
{
"categories": [
{
"name": "Cult. Urgent",
"topic": "cultivation_urg"
}
],
"custom_id": "loc_01",
"name": "Tomatoes"
},
{
"categories": [
{
"name": "Cult. Not Urgent",
"topic": "cultivation_not_urg"
}
],
"custom_id": "loc_02",
"name": "Peppers"
}
]
}
cURL code:
curl -X 'POST' \
'http://192.168.10.72/rest_api/1/MinimalConfig' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTI1MzQ0ODgsIm5iZiI6MTYxMjUzNDQ4OCwianRpIjoiNjY0NzI2NzAtYTRkMi00N2ZmLWFiMjUtNzAyMGYwOTkwNWJhIiwiZXhwIjoxNjEyNTM3OTg4LCJpZGVudGl0eSI6IlJFU1QtQVBJXzAwMDUiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MiLCJ1c2VyX2NsYWltcyI6eyJ1c2VyX2lkIjo1LCJyb2xlX2lkIjo1LCJsYW5ndWFnZSI6Im5sLU5MIn19.6xlCrMjNsKd9Eyq5ieS-MScZe6P1idstMCKPs5dfOd8' \
-H 'Content-Type: application/json' \
-d '{
"locations": [
{
"categories": [
{
"name": "Cult. Urgent",
"topic": "cultivation_urg"
}
],
"custom_id": "loc_01",
"name": "Tomatoes"
},
{
"categories": [
{
"name": "Cult. Not Urgent",
"topic": "cultivation_not_urg"
}
],
"custom_id": "loc_02",
"name": "Peppers"
}
]
}'
Response:
{
"locations": [
{
"name": "Tomatoes",
"custom_id": "loc_01",
"categories": [
{
"name": "Cult. Urgent",
"topic": "cultivation_urg"
}
]
},
{
"name": "Peppers",
"custom_id": "loc_02",
"categories": [
{
"name": "Cult. Not Urgent",
"topic": "cultivation_not_urg"
}
]
}
]
}
When you have added all data, you can retrieve these locations using the API GET: /MinimalConfig.
GET: /MinimalConfig
cURL code:
curl -X 'GET' \
'http://192.168.10.72/rest_api/1/MinimalConfig' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTI1MzQ0ODgsIm5iZiI6MTYxMjUzNDQ4OCwianRpIjoiNjY0NzI2NzAtYTRkMi00N2ZmLWFiMjUtNzAyMGYwOTkwNWJhIiwiZXhwIjoxNjEyNTM3OTg4LCJpZGVudGl0eSI6IlJFU1QtQVBJXzAwMDUiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MiLCJ1c2VyX2NsYWltcyI6eyJ1c2VyX2lkIjo1LCJyb2xlX2lkIjo1LCJsYW5ndWFnZSI6Im5sLU5MIn19.6xlCrMjNsKd9Eyq5ieS-MScZe6P1idstMCKPs5dfOd8'
Response:
{
"locations": [
{
"name": "Tomatoes",
"custom_id": "loc_01",
"categories": [
{
"name": "Cult. Urgent",
"topic": "cultivation_urg"
}
]
},
{
"name": "Peppers",
"custom_id": "loc_02",
"categories": [
{
"name": "Cult. Not Urgent",
"topic": "cultivation_not_urg"
}
]
}
]
}
Good to know: Are you working with MinimalConfig? The system will then add locations and categories automatically. You can skip these steps.
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.