MinimalConfig
Tip: kan uw externe apparaat werken met CRUD-bewerkingen? Maak dan gebruik van deze communicatie met de Touch Pro of ARA. Met de CRUD-methode voegt u zelf locaties en categorieën toe. De benodigde API-methoden vindt u bij Locaties en Categorieën.
Beschrijving van de API-elementen
| Element | Beschrijving |
|---|---|
| custom_id | U stelt hiermee een unieke locatie-ID in. |
| topic | U geeft hiermee een unieke, zelfgekozen categorie-ID op. |
| name | Dit is de naam van de categorie. Deze naam verschijnt in het logboek en op het scherm. |
| name | Dit is de naam van de locatie. U ziet deze naam in het alarmrapport (spraak of tekst), het logboek en op het scherm. |
Let op: voor MinimalConfig zijn alleen een GET- en POST-API beschikbaar. Wilt u elementen achteraf wijzigen of verwijderen? Voer dan opnieuw een POST uit met de gewenste gegevens.
API-methoden
In de situatieschets van het praktijkvoorbeeld staan twee locaties: Tomaten en Paprika's.
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"
}
]
}'
Respons:
{
"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"
}
]
}
]
}
Wanneer alle data is toegevoegd, kunt u deze locaties opvragen met de 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'
Respons:
{
"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"
}
]
}
]
}
Goed om te weten: werkt u met MinimalConfig? Dan voegt het systeem locaties en categorieën automatisch toe. U kunt deze stappen dan overslaan.
Nadat u de locaties en categorieën hebt aangemaakt, kunt u de REST API gebruiken voor alarmering. U leest meer over het alarmeringsproces in Alarmrapportage.