Wiki-Quellcode von inventory/get_latest_history.php
Version 1.1 von Dominic Lippmann am 2025/03/04 16:31
Zeige letzte Bearbeiter
author | version | line-number | content |
---|---|---|---|
1 | (% class="box" %) | ||
2 | (((Inhaltsverzeichnis))) | ||
3 | {{toc/}} | ||
4 | |||
5 | Gibt den jeweils aktuellsten Status samt Position zu einem oder mehreren Objekten zurück. | ||
6 | = Beschreibung = | ||
7 | //**GET **////**/inventory/get_latest_history.php?company**=RTI_COMPANYKEY**&import**=IMPORTKEY// | ||
8 | = Parameter = | ||
9 | |=Parameter|=Beschreibung|=Typ|=Hinweis|=Pflicht | ||
10 | |company|RTI Firmenschlüssel|string||ja | ||
11 | |import|RTI Importschlüssel|string||ja | ||
12 | |offset||int|Pro Abfrage werden bis zu 1000 Einträge zurück geliefert. Um weitere Einträge zu erhalten, können Sie ein Offset angeben.|nein | ||
13 | |profiles[]|Profiles UUID|[] string|optionale Einschränkung auf eine Liste an Objektprofilen|nein | ||
14 | |objects[]|Objects UUID|[] string|optionale Einschränkung auf eine Liste an Objekten|nein | ||
15 | |groups[]|Gruppenname UUID|[] string|optionale Einschränkung auf eine Liste an Objektgruppen|nein | ||
16 | |with_beacon|Beacon Positionsmeldungen|bool| ((( | ||
17 | * false: der letzte Status wird nur anhand der gebuchten Aktivitäten zurückgegeben | ||
18 | * true: Als Zeitpunkt des letzten Status werden auch Beacon-Positionsmeldungen beachtet. | ||
19 | )))|nein | ||
20 | |||
21 | = Rückgabe = | ||
22 | Bei Erfolg erhalten Sie die Rückgabe im JSON Format. Bei fehlenden Pflichtparametern oder Fehlern wird ein "(% class="error" %)**ERROR:Beschreibung**(%%)" zurückgegeben. | ||
23 | |||
24 | == Mögliche Fehlerwerte == | ||
25 | |=Fehler|=Beschreibung | ||
26 | |MISSING_COMPANY|Firmenschlüssel fehlt | ||
27 | |INVALID_COMPANY|Firma nicht gefunden. Dies kann an einem fehlerhaften Firmen- oder Import-Schlüssel liegen. | ||
28 | |ERROR_MAINTENANCE|Ihre Firma wird gerade gewartet, währenddessen sind keine RTI Abfragen möglich. | ||
29 | |MISSING_IMPORT|Import-Schlüssel fehlt. | ||
30 | |INVENTORY_NOT_ACTIVATED|Objektverwaltung ist für ihre Firma nicht aktiviert. | ||
31 | |INVALID_FORMAT_OFFSET|Offset ist falsch. | ||
32 | |||
33 | == JSON == | ||
34 | Die genaue Spezifikation finden Sie anhand einer JSON Schema Datei [[hier>>https://vitaliirodin.developers.yellowfox.net/rti/schema/get_latest_history_schema.json]]. | ||
35 | |||
36 | **Beispiel Ausgabe** | ||
37 | |||
38 | {{code language="js"}}{ | ||
39 | "_date": "2025-02-26T10:17:58+01:00", | ||
40 | "_links": { | ||
41 | "next": { | ||
42 | "href": null | ||
43 | } | ||
44 | }, | ||
45 | "events": [ | ||
46 | { | ||
47 | "uuid": "7a2f9959-7ee1-83ec-8599-59901fcbfd93", | ||
48 | "description": "TestBeacon", | ||
49 | "gpsdate": "2025-02-26T11:11:06+01", | ||
50 | "last_status": { | ||
51 | "value": "aktiv", | ||
52 | "description": "Status" | ||
53 | }, | ||
54 | "vehicle_sign": null, | ||
55 | "driver_key": null, | ||
56 | "driver_name": null, | ||
57 | "lat": 51.036697, | ||
58 | "lon": 13.599357, | ||
59 | "satellites": 9, | ||
60 | "text_position": null, | ||
61 | "customer_text": "Würth", | ||
62 | "orderdescr": null, | ||
63 | "data_source": "position", | ||
64 | "activities": [] | ||
65 | }, | ||
66 | { | ||
67 | "uuid": "a5ddb6a3-20ad-a418-5236-bc7e6a229b55", | ||
68 | "description": "046C8", | ||
69 | "gpsdate": "2025-02-26T11:11:06+01", | ||
70 | "last_status": { | ||
71 | "value": "AAAA", | ||
72 | "description": "dsfdsfsd" | ||
73 | }, | ||
74 | "vehicle_sign": null, | ||
75 | "driver_key": null, | ||
76 | "driver_name": null, | ||
77 | "lat": 51.036682, | ||
78 | "lon": 13.5993805, | ||
79 | "satellites": 9, | ||
80 | "text_position": null, | ||
81 | "customer_text": "Würth", | ||
82 | "orderdescr": null, | ||
83 | "data_source": "position", | ||
84 | "activities": [] | ||
85 | } | ||
86 | ] | ||
87 | }{{/code}} | ||
88 | |||
89 | = Beispielaufrufe = | ||
90 | |https:~/~/map.yellowfox.de/rti/inventory/get_latest_history.php?company=COMPANY_RTIKEY&import=IMPORT_RTIKEY |