-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Funktionen auslesen #9
Comments
Hallo Daniel, Sry für die späte Antwort, wir haben nun auch die Funktionen über die API freigeschalten. Ich füge sie gleich zu den docs hinzu. Beste Grüße, Philip |
Hallo! <?php
const DASHBOARD_BASE_URL = 'https://api.blaulichtsms.net/blaulicht/api/alarm/v1/dashboard/';
// FILL IN THE SESSION ID BELOW
const DASHBOARD_URL = DASHBOARD_BASE_URL . SESSION_ID;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, DASHBOARD_URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$curlResponse = curl_exec($ch);
curl_close($ch);
$dashboardResult = json_decode($curlResponse);
foreach ($dashboardResult->alarms as $alarm) {
echo("<b> <u>Alarm:</u> $alarm->alarmText </b><br>");
foreach ($alarm->recipients as $recipient) {
echo("Name: $recipient->name <br> Status: $recipient->participation <br> Antwortnachricht: $recipient->functions <br><br>");
foreach ($alarm->functions as $functions) {
echo("Name: $functions->name ");
}
echo("<hr>");
}}
?> Gibt es auch eine Möglichkeit, die Rückmeldungen der Mitglieder zu sortieren? In Ja, Nein usw. Lg |
Hallo @19flashover69 Die Funktionen hängen nicht direkt am Alarm, sondern wir liefern die Liste der Funktionen für jeden Teilnehmer mit aus. Folgender Code würde funktionieren: foreach ($alarm->recipients as $recipient) {
echo("Name: $recipient->name <br> Status: $recipient->participation <br> Antwortnachricht:
$recipient->participationMessage <br><br>");
foreach ($recipient->functions as $function) {
echo("Funktion: $function->name ");
}
echo("<hr>");
} Bzgl. der Sortieren, könntest du zum Beispiel die PHP Funktion array_multisort verwenden. Beste Grüße, |
Dankesehr :-) Kann BlaulichtSMS eigentlich unterscheiden ob ein Einsatz bereits beendet wurde? Lg |
Gibt es eine Möglichkeit die Funktionen über das API auszulesen?
Vielen Dank!
MfG
Daniel
The text was updated successfully, but these errors were encountered: