Wiki source code of positions/get_pos_data.php

Last modified by Dominic Lippmann on 2025/03/05 13:14

Show last authors
1 (% class="box" %)
2 (((
3 Table of Contents
4 )))
5
6 {{toc/}}
7
8 Return the position data of a single vehicle.
9 If no date is given, it will return the current position.
10
11 = Description =
12
13 (% class="green mark" %)**GET**(%%)** positions/get_pos_data.php?company**=//COMPANY_RTIKEY//**&vehicle**=//VEHICLE_RTIKEY//**&start**=//YYYY-MM-DDTHH:MM:SS+HH:MM**&end**//=//YYYY-MM-DDTHH:MM:SS+HH:MM//
14
15 = Parameter =
16
17 |=parameter|=description|=type|=hint|=mandatory
18 |company|RTI company key|string| |yes
19 |vehicle|RTI vehicle key|string| |yes
20 |start|start of query date range|datestring|Format: ISO 8601 (//YYYY-MM-DDTHH:MM:SS+HH:mm//)|no
21 |end|end of query date range|datestring|Format: ISO 8601 (//YYYY-MM-DDTHH:MM:SS+HH:mm//)|no
22 |query_date|point of time to get the position for|datestring|Format: ISO 8601 (//YYYY-MM-DDTHH:MM:SS+HH:mm//)|no
23 |format|output format|string|json (default)|no
24 |date_type|Which date is the base for date restriction?|string|'insert' (default) = execution date
25 'gps' = date when the messaged was generated|no
26 |additional_data|additional parameters to gather more data|string[]|(((
27 * 'temp' gathers the value if digital temperature sensors 1-8 and analogue temperature sensors 1-4
28 * 'trailer' gathers all the trailer informations
29 )))|no
30 |hide_display|hide position messages generated by connected display|int|(((
31 * 0 (default) = display messages are being returned
32 * 1 = display messages are not being returned
33 )))|no
34 |offset|The request returns 5000 data records at max. Use offset to access the next block.|int| |no
35
36 (% class="box" %)
37 (((
38 **Hint for date restriction**
39 You can use 3 different modes
40 a) Use start and end and get all positions within this timerange (the difference  between these dates can not be more than 24 hours)
41 b) Just use query_date to get the most current position message of each vehicle at this point of time
42 c) Use no date parameter to just get the most current message of each vehicle right now
43 )))
44
45 = Output =
46
47 A **string** is being returned. Will return "(% class="error" %)**ERROR:description**(%%)" on error.
48
49 == Field descriptions ==
50
51 |=Field|=Description
52 |vehicle_sign|vehicle sign
53 |rti_ident|RTI ident
54 |insert_date|When was this message processed by YellowFox?
55 |gps_date|When was this message sent by the vehicle?
56 |lat|latitude
57 |lon|logitude
58 |text_position|text address of GPS position
59 |customer|customer name (if the address belongs to a customer)
60 |direction|direction in degree
61 |satellites|number of satellites used for getting GPS position
62 |speed|speed in km/h
63 |ignition|Is ignition on (1) or off (0)?
64 |reason|Why was this position message sent?
65 |km|odometer
66 |bszX|value of operating hours counter
67 |driver_X|name of driver
68 |driverkey_X|personnel key of driver
69 |eta_time|If navigating to a target: planned arrival
70 |eta_distance|If navigating to a target: remaining distance
71 |eta_duration|If navigating to a target: remaining duration
72 |eta_lat|If navigating to a target: latitude of target
73 |eta_lon|If navigating to a target: longitude of target
74 |eta_desc|If navigating to a target: text address of target
75 |digital_inputs|(((
76 status of telemetry inputs
77 nr = number of input (1 to 7)
78 name = name of input
79 state = status of input as text
80 value =  status of input (1 = on, 0 = off)
81
82 ident = technical attribute, can be set via object-specific settings
83 )))
84 |trailer_info|Optional field. Includes information about connected trailer.
85 date = date of status
86 type = connected to trailer (TRAILER) or towing vehicle (VEHICLE)
87 name = name of connected trailer / towing vehicle
88 rti_ident = RTI Ident of connected trailer
89 state = connection state (CONNECTED or DISCONNECTED)
90 |digital_temperature_values|Optional field. Includes digital temperature data.
91 nr = number of input
92 value = temperature in °C
93 set_point = target value in °C
94 |analogue_temperature_values|Optional field. Includes analogue temperature data.
95 nr = number of input
96 value = temperature in °C
97
98 == JSON ==
99
100 You can find a JSON schema description for this result set [[here>>https://map.yellowfox.de/rti/schema/get_pos_data_schema.json]].
101
102 {{code language="java"}}
103 {    
104 "_date" => null,
105 "_links" => {
106 "next" => {
107 "href" => null
108 }
109 },
110 "has_more" => false,    
111 "items": [
112 {
113 "vehicle_sign": "FTL YF 123",
114 "rti_ident": "",
115 "insert_date": "2022-09-22T13:23:35+02:00",
116 "gps_date": "2022-09-22T13:23:23+02:00",
117 "lat": 48.20398,
118 "lon": 16.22613,
119 "text_position": "A-1140 Wien (Penzing) Wientalstraße (B1)",
120 "customer": null,
121 "direction": 155,
122 "satellites": 12,
123 "speed": 0,
124 "ignition": 0,
125 "reason": "AnalogMinuteInterval",
126 "km": 361549,
127 "bsz1": null,
128 "bsz2": null,
129 "driver_1": null,
130 "driverkey_1": null,
131 "driver_2": null,
132 "driverkey_2": null,
133 "eta_time": null,
134 "eta_distance": null,
135 "eta_duration": null,
136 "eta_lat": null,
137 "eta_lon": null,
138 "eta_desc": null,
139 "digital_inputs": [
140 {
141 "nr": 2,
142 "name": "Sensor 2",
143 "state": "",
144 "value": 0,
145 "ident": null
146 }
147 ],
148 "trailer_info": {
149 "date": "2022-09-22T13:18:35+02:00",
150 "type": "TRAILER",
151 "name": "Trailer 123",
152 "rti_ident": "TR_ID",
153 "state":"CONNECTED"
154 },
155 "digital_temperature_values": [
156 {
157 "nr": 1,
158 "value": 13.2,
159 "set_point": 13.3
160 }
161 ],
162 "analogue_temperature_values": [
163 {
164 "nr": 1,
165 "value": 21.56
166 },
167 {
168 "nr": 2,
169 "value": 11.83
170 }
171 ]
172 }
173 ]
174 }
175 {{/code}}
176
177 = example calls =
178
179 **Query fixed date for a vehicle**
180 {{code language="java"}}https://map.yellowfox.de/rti/positions/get_pos_data.php?company=COMPANY_RTIKEY&vehicle=VEHICLE_RTIKEY&query_date=2022-09-22T13:23:00%2B00:00:00{{/code}}
181
182 **Query current point of time for a vehicle with RTI ident**
183 {{code language="java"}}https://map.yellowfox.de/rti/positions/get_pos_data.php?company=COMPANY_RTIKEY&vehicle={"type":"car_ident","groupKey":"GROUP_RTIKEY","ident":"VEHICLE_IDENT"}{{/code}}