Wiki source code of get_d8_bookings.php
Last modified by YellowFox_RD on 2025/01/23 09:15
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% class="box" %) | ||
2 | ((( | ||
3 | Table of Contents | ||
4 | ))) | ||
5 | |||
6 | {{toc/}} | ||
7 | |||
8 | (% class="box" %) | ||
9 | ((( | ||
10 | **compatibility** | ||
11 | To us this function, you need one vehicle with activated D8-interface | ||
12 | ))) | ||
13 | |||
14 | Return all bookings of D8 interface. | ||
15 | You need at least an activated RTI interface and an generated RTI-Key for requested vehicles! | ||
16 | |||
17 | = Description = | ||
18 | |||
19 | (% class="green mark" %)**GET**(%%)** **get_d8_bookings.php?**company**=COMPANY_RTIKEY**&import**=//COMPANY_IMPORTKEY//**&start**=//YYYYMMDDHHMMSS//**&end**=//YYYYMMDDHHMMSS//**&format**=//CSV// | ||
20 | |||
21 | = Parameter = | ||
22 | |||
23 | |=Parameter|=Description|=Type|=Note|=Mandatory | ||
24 | |company|RTI company key|string| |yes | ||
25 | |import|RTI import key|string|either import, vehicle or group Parameter|(yes) | ||
26 | |vehicle|RTI vehicle key|string|either import, vehicle or group Parameter|(yes) | ||
27 | |group|RTI group key|string|either import, vehicle or group Parameter|yes | ||
28 | |start|Startzeitpunkt der Ausgabe|string|the requested persiod may not exceed 31 days|yes | ||
29 | |end|Endzeitpunkt der Ausgabe|string|the requested persiod may not exceed 31 days|yes | ||
30 | |format|return format|string|support((( | ||
31 | * csv | ||
32 | * json | ||
33 | )))|yes | ||
34 | |||
35 | = Return = | ||
36 | |||
37 | Return a **string**. In case of error it returns "(% class="error" %)**ERROR:Description**(%%)". | ||
38 | |||
39 | == JSON format == | ||
40 | |||
41 | return a string as json | ||
42 | |||
43 | === Example output === | ||
44 | |||
45 | **return in json** | ||
46 | {{code language="js"}}[ | ||
47 | { | ||
48 | "date": "2020-03-01T02:25:04+01:00", | ||
49 | "vehicle": "YF1234", | ||
50 | "ignition": 0, | ||
51 | "lat": 51.04, | ||
52 | "lon": 13.6, | ||
53 | "key": "DF47110815123000", | ||
54 | "eventtype": 1, | ||
55 | "state": 0, | ||
56 | "eventid": "CF1C6C0DA98DC17B48B7C4C7DD3F0EE428EF9A61" | ||
57 | }, | ||
58 | { | ||
59 | "date": "2020-03-01T02:25:24+01:00", | ||
60 | "vehicle": "YF1234", | ||
61 | "ignition": 0, | ||
62 | "lat": 51.04, | ||
63 | "lon": 13.6, | ||
64 | "key": null, | ||
65 | "eventtype": 3, | ||
66 | "state": 1, | ||
67 | "eventid": "EF8F2B94F43228F8F6151D050413E5D9BEFBDE96" | ||
68 | } | ||
69 | ]{{/code}} | ||
70 | |||
71 | == CSV Format == | ||
72 | |||
73 | === Meta informations === | ||
74 | |||
75 | |=Separator|Semicolon ( ; ) | ||
76 | |=Delimiter|Double quote | ||
77 | |=Line break|0x0D 0x0A (CarriageReturn LineFeed) | ||
78 | |=Header|Line1 | ||
79 | |=Coding|Windows-1252 | ||
80 | |||
81 | === CSV Columns === | ||
82 | |||
83 | |=Column|=Description|= | ||
84 | |DATE|date and time of digitacho|format ISO 8601 | ||
85 | |VEHICLE|user defined RTI vehicle ident | ||
86 | (if the user define no vehicle ident, we return the vehicle sign)| | ||
87 | |IGNITION|ignition state by digitacho|1: ignition on | ||
88 | 0: ignition off | ||
89 | |LAT|latitude| | ||
90 | |LON|longitude| | ||
91 | |KEY|driver key| | ||
92 | |EVENTTYPE|event|0: card activitity on 1. Slot | ||
93 | 1: card activity on 2. Slot | ||
94 | 2: Activity on 1. Slot | ||
95 | 3: Activity on 2. Slot | ||
96 | |STATE|state|Event 0/1: | ||
97 | 0: card removed | ||
98 | 1: card inserted | ||
99 | Event 2/3: | ||
100 | 0: pause or rest | ||
101 | 1: standby time | ||
102 | 2: work time | ||
103 | 3: steering time | ||
104 | |EVENTID|unique hash of booking| | ||
105 | |||
106 | === Example output === | ||
107 | |||
108 | **Ausgabe in CSV** | ||
109 | {{code language="java"}}"DATE";"VEHICLE";"IGNITION";"LAT";"LON";"KEY";"EVENTTYPE";"STATE","EVENTID" | ||
110 | "2020-03-01T02:25:04+01:00";"YF1234";1;51.04;13.6;"DF47110815123000";1;0;"CF1C6C0DA98DC17B48B7C4C7DD3F0EE428EF9A61" | ||
111 | "2020-03-01T02:25:24+01:00";"YF1234";0;51.04;13.6;"DF47110815123000";3;1;"EF8F2B94F43228F8F6151D050413E5D9BEFBDE96"{{/code}} | ||
112 | |||
113 | = Example call = | ||
114 | |||
115 | **Request in CSV format** | ||
116 | {{code language="java"}}https://map.yellowfox.de/rti/get_d8_bookings.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&start=20200302000000&end=20200305235959&format=CSV{{/code}} |