Wiki source code of inventory/get_history.php

Last modified by YellowFox_RD on 2025/03/04 16:27

Show last authors
1 (% class="box" %)
2 (((
3 Table of Contents
4 )))
5
6 {{toc/}}
7
8 Returns a list of booked acticities and position updates (position updates only available, if the item is connected with a YellowFox beacon) for one or multiple items and a given time range.
9
10 = Description =
11
12 (% class="green mark" %)**GET**(%%)//**/inventory/get_history.php?company**=RTI_COMPANYKEY**&import**=RTI_IMPORTKEY//
13
14 = Parameter =
15
16 |=Parameter|=Descriptions|=Type|=Hint|=Mandatory
17 |company|RTI company key|string| |yes
18 |import|RTI import key|string| |yes
19 |offset| |unsigned int|Pro Abfrage werden bis zu 1000 Einträge zurück geliefert. Um weitere Einträge zu erhalten, können Sie ein Offset angeben.|no
20 |date_from|(% rowspan="2" %)Format: ISO 8601
21 (YYYY-MM-DD)|date string|Get history entries from start time.
22 If nothing set assume a start date 1 month in past.|no
23 |date_to|date string|Get history until end time.
24 If nothing set, use current time as end time|no
25 |profiles[]|profiles UUID|[] string|optional limitation to a list of given profiles|no
26 |objects[]|objects UUID|[] string|optional limitaiton to a list of given items|no
27 |groups[]|group UUID|[] string|optional limitiation to a list of given object groups|no
28 |with_beacon|Beacon position updates|bool|(((
29 * false: only return booked item or state changes
30 * true: additionally return all beacon position updates(((
31 * Keep in mind: This may result in large response data.
32 )))
33 )))|no
34
35 (% class="box" %)
36 (((
37 **Remark for date range setting**
38 The setting will work in 3 modes:
39 a) If no date set (date_from/date_to), all entries during last month will be returned.
40 b) If only start date is set (date_from), return all events from this date until now (up to 1 month).
41 c) If both date values set (date_from, date_to), all events in time range will returned (up to 1 month)
42 )))
43
44 = Return value =
45
46 On success you will receive the result as json. On missing parameters or errors you will receive "(% class="error" %)**ERROR:description**(%%)".
47
48 == Possible error values ==
49
50 |=Fehler|=Beschreibung
51 |ERROR_MAINTENANCE|Your company is under maintenance, no RTI request are possible at the moment.
52 |INVALID_COMPANY|Company not found. Company key or import key might be faulty.
53 |INVENTORY_NOT_ACTIVATED|Inventory management is not activated for your company.
54 |MISSING_COMPANY|Company key is missing.
55 |MISSING_IMPORT|Import key is missing.
56 |INVALID_DATE_RANGE|Time range invalid or exceeded 1 month
57 |MISSING_DATE_FROM|Start date missing (required, if end date is set)
58 |INVALID_FORMAT_OFFSET|Offset value faulty
59
60 == JSON ==
61
62 You can access the specification as a JSON Schema file [[here>>https://map.yellowfox.de/rti/schema/get_history_schema.json]].
63
64 **Output example**
65
66 {{code language="js"}}
67 {
68     "_date": "2025-02-26T10:13:17+01:00",
69     "_links": {
70         "next": {
71             "href": null
72         }
73     },
74     "events": [
75         {
76             "uuid": "7d64c6ac-49fd-0d4e-27e6-f7c1ea727b2b",
77             "gpsdate": "2025-02-25T11:59:20+01",
78             "data_source": "booking",
79             "driver_name": null,
80             "vehicle_sign": null,
81             "lat": 0,
82             "lon": 0,
83             "satellites": 0,
84             "text_position": "",
85             "customer_text": null,
86             "activities": [
87                 {
88                     "value": "Abgesetzt",
89                     "description": "Status"
90                 },
91                 {
92                     "value": "Bauhof",
93                     "description": "Status"
94                 },
95                 {
96                     "value": 1,
97                     "description": "Betriebsgewicht"
98                 },
99                 {
100                     "value": 12,
101                     "description": "Verdichtungstiefe"
102                 },
103                 {
104                     "value": 22,
105                     "description": "Flächenleistung"
106                 },
107                 {
108                     "value": "Hallo",
109                     "description": "Status 2"
110                 },
111                 {
112                     "value": 1,
113                     "description": "test"
114                 }
115             ]
116         },
117         {
118             "uuid": "a5ddb6a3-20ad-a418-5236-bc7e6a229b55",
119             "gpsdate": "2025-02-25T11:58:29+01",
120             "data_source": "position",
121             "driver_name": null,
122             "vehicle_sign": null,
123             "lat": 51.03629,
124             "lon": 13.59799,
125             "satellites": 8,
126             "text_position": null,
127             "customer_text": "test",
128             "activities": []
129         }
130
131     ]
132 }
133 {{/code}}
134
135 = Example calls =
136
137 {{code language="java"}}
138 https://map.yellowfox.de/rti/inventory/get_history.php?company=COMPANY_RTIKEY&import=IMPORT_RTIKEY
139 {{/code}}