Abrufen von Belegungsdaten
Über folgenden API-Call können Informationen zur Auslastung von einem Standort abgerufen werden.
curl -X GET --location "https://<jawengo-url>/api/location/<location-id>/power"
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "API_KEY: <api-key>"
-d "{\"date\": \"<date, e.g. 2022-09-30>\"}"
Platzhalter:
jawengo-url: Die URL zur Website des Sportcenter
location-id: Die Datenbank-ID der Location. Diese kann im Backend in der Formularansicht der Location aus der URL gelesen werden (...#id=NNN)
api-key: Der API-Key kann im Backend in der Benutzerpflege für einen Benutzer gelöst werden. Dieser Key muss mindestens Portal Zugriffsrechte haben um die Daten für die Steuerung abzurufen.
Parameter:
date: Datum im Format YYYY-MM-DD
optional, Standardwert: aktuelles Datum
Rückgabewerte:
{
"jsonrpc": "2.0",
"id": null,
"result": {
"date": "2022-09-30",
"location_id": 3,
"location_state": "open",
"location_name": "Air Dome",
"slots": [
{
"time_from": 7.0,
"free_pitches": 1,
"used_pitches": 0,
"total_pitches": 1,
"heat_state": "cold",
"light_states": [
{
"pitch_id": 28,
"pitch_name": "Court 7",
"light_state": "off"
}
]
},
{
"time_from": 8.0,
"free_pitches": 0,
"used_pitches": 1,
"total_pitches": 1,
"heat_state": "warm",
"light_states": [
{
"pitch_id": 28,
"pitch_name": "Court 7",
"light_state": "on"
}
]
},
...,
{
"time_from": 23.0,
"free_pitches": 1,
"used_pitches": 0,
"total_pitches": 1,
"heat_state": "cold",
"light_states": [
{
"pitch_id": 28,
"pitch_name": "Court 7",
"light_state": "off"
}
]
}
]
}
}
"jsonrpc": "2.0",
"id": null,
"result": {
"date": "2022-09-30",
"location_id": 3,
"location_state": "open",
"location_name": "Air Dome",
"slots": [
{
"time_from": 7.0,
"free_pitches": 1,
"used_pitches": 0,
"total_pitches": 1,
"heat_state": "cold",
"light_states": [
{
"pitch_id": 28,
"pitch_name": "Court 7",
"light_state": "off"
}
]
},
{
"time_from": 8.0,
"free_pitches": 0,
"used_pitches": 1,
"total_pitches": 1,
"heat_state": "warm",
"light_states": [
{
"pitch_id": 28,
"pitch_name": "Court 7",
"light_state": "on"
}
]
},
...,
{
"time_from": 23.0,
"free_pitches": 1,
"used_pitches": 0,
"total_pitches": 1,
"heat_state": "cold",
"light_states": [
{
"pitch_id": 28,
"pitch_name": "Court 7",
"light_state": "off"
}
]
}
]
}
}