Wiki source code of get_timerecording.php

Last modified by YellowFox_RD on 2025/01/23 10:42

Show last authors
1 (% class="box" %)
2 (((
3 Table of Contents
4 )))
5
6 {{toc/}}
7
8 (% class="box" %)
9 (((
10 **Compatibility**
11 This function is intended to be used with timerecording V3
12 If you are using the older V2 version, please use [[get_timerecording.asp>>doc:YellowFox Remote Tracking Interface.Funktionen.Zeiterfassung.get_timerecording\.asp.WebHome]]
13 )))
14
15 Returns all received timerecording bookings for the requested time range. This range may refer to the processing time in our computing center or to the booked date and time.
16 In case you are using bookings based on digitacho files, there is a delay of multiple hours between the booked time and when this booking is available via rti. The digitacho files with all bookings per (work) day are typically submitted at the next work day. Then this digitacho bookings will be translated into time bookings and are available after this is done. So working with digitacho bookings requires to use the insert date to get catch all bookings without a gap.
17
18 = Description =
19
20 (% class="green mark" %)**GET**(%%)** get_timerecording.php?company**=//COMPANY_RTIKEY//**&import**=//COMPANY_IMPORTKEY//**&start**=//YYYYMMDDHHMMSS//**&end**=//YYYYMMDDHHMMSS//**&format**=//CSV//**&version**=//1//**&date_query**//=insert//
21
22 = Parameter =
23
24 |=Parameter|=Description|=Type|=Note|=Mandatory
25 |company|RTI company key|string| |yes
26 |import|RTI import key|string| |yes
27 |start|start time for output|string|the difference between start and end must not ecxeed 31 days|yes
28 |end|end time for output|string|the difference between start and end must not ecxeed 31 days|yes
29 |format|output format|string|valid output formats(((
30 * csv
31 * json
32 * xml
33 * buspronet
34 * gfos
35 )))|yes
36 |version|version number for request|integer|currently there is only the version 1
37 on change of any output parameter this version number will change, too|no
38 |date_query|set the date reference for request|string|'insert' (default) = get bookings by processing time
39 'gps' = get booking by booked date and time (if 'with_changes=1' active and a booked time was modified, this modified time is relevant)
40 'update' = ONLY for 'with_changes=1'; common result similar to option 'insert', for changed bookings, the change date will be used|no
41 |group|Name of the personnel group to which the restriction is to be made|string|The exact name of a personnel group must be given|no
42 |with_changes|indicates if changes, done in portal will be applied to returned bookings or not
43 if so, bookings deleted in portal won't be returned anymore|integer|0 (default) = always return unmodified bookings
44 1 = apply changes so the resultset is similar to the visible result in web portal|no
45
46 = Return values =
47
48 This funtion returns a **string**. On error the return will be "**Error:Description**".
49
50 == CSV Format ==
51
52 Returning a row per booking with all the data as defined below
53
54 === Meta informations ===
55
56 |=Separator|Semicolon ( ; )
57 |=Delimiter|Double quote ( " )
58 |=Line break|0x0D 0x0A (CarriageReturn LineFeed)
59 |=Header|Row 1
60 |=Encoding|Windows-1252
61
62 === Columns ===
63
64 |=Column|=Description|=
65 |PERSON_ID|(((
66 //self defined person number//
67 )))|in personell administration listed as MA-Nr
68 |PERSON_KEY|Booking key, used by person|
69 |PERSON_NAME|name of person|
70 |PERSON_CARD_NUMBER|(((
71 //self defineable additional booking number//
72 )))|in personell administration listed as Card-Nr
73 |DATETIME|Date|format DD.MM.YYYY HH:MM:SS
74 |ACTIVITY_ID|Short booging type definition|
75 |ACTIVITY_NAME|Description text for booking as defined|
76 |TERMINAL_ID|rti ident of booking terminal|as set via rti settings → rti ident per vehicle
77 |TERMINAL_NAME|name of the booking terminal|usually the vehicle sign
78 |LAT|Latitude|
79 |LON|Longitude|
80 |ADDRESS|Aufgelöster Positionstext|
81 |AREA|areas, as defined for this Position|delimiter: "%~|%"
82 |DRIVERKEY|personal key of person who did the booking|
83 |COST_CENTER_ID|technical ident of cost center|
84 |COST_CENTER_NAME|name of used cost center|
85
86 === Example ===
87
88 **return in csv**
89 {{code language="java"}}"PERSON_ID";"PERSON_KEY";"PERSON_NAME";"PERSON_CARD_NR";"DATETIME";"ACTIVITY_ID";"ACTIVITY_NAME";"TERMINAL_ID";"TERMINAL_NAME";"LAT";"LON;""ADDRESS";"AREA";"COST_CENTER_ID";"COST_CENTER_NAME"
90 "A23";"DF000000000123";"John Smith";"";"01.10.2019 08:00:00";"1023";"work";"CAR_17";"DD-YF 123";"51.4";"13.1";"Musterstraße 17, 01234 Musterstadt";"Hauptzentrale";"K-47";"common work"
91 "A23";"DF000000000123";"John smith";"";"01.10.2019 12:00:00";"1024";"break";"CAR_17";"DD-YF 123";"52.0";"11.3";"Testweg 23, 91234 Testhausen";"Müller GmbH";"";""{{/code}}
92
93 == JSON Format ==
94
95 Returns a JSON formatted string with detailed data per booking
96
97 === Example output ===
98
99 **JSON output**
100 {{code language="js"}}[
101 {
102 "person": {
103 "id": "A23",
104 "key": "DF00000001234",
105 "name": "John Smith",
106 "card_nr": null
107 },
108 "datetime": "2019-04-01 05:26:00",
109 "activity": {
110 "id": "1003",
111 "name": "work time"
112 },
113 "terminal": {
114 "id": "C_32",
115 "name": "DD-YF 456"
116 },
117 "position": {
118 "lat": 51.4,
119 "lon": 13.1,
120 "address": "Am Wüsteberg 3, 01723 Kesselsdorf"
121 },
122 "area": null,
123 "costcenter": {
124 "id": null,
125 "name": null
126 }
127 },
128 {
129 "person": {
130 "id": "A23",
131 "key": "DF00000001234",
132 "name": "John Smith",
133 "card_nr": null
134 },
135 "datetime": "2019-04-01 12:35:00",
136 "activity": {
137 "id": "1001",
138 "name": "break time"
139 },
140 "terminal": {
141 "id": "C-1",
142 "name": "central"
143 },
144 "position": {
145 "lat": 52.0,
146 "lon": 11.9,
147 "address": "Am Wüsteberg 3, 01723 Kesselsdorf"
148 },
149 "area": null,
150 "costcenter": {
151 "id": "K-47",
152 "name": "common"
153 }
154 }{{/code}}
155
156 == XML Format ==
157
158 **XML output**
159 {{code language="xml"}}<?xml version="1.0"?>
160 <bookings>
161 <booking>
162 <person>
163 <id/>
164 <key>DF00000001234</key>
165 <name>John Smith</name>
166 <card_nr/>
167 </person>
168 <datetime>2019-04-01 05:26:00</datetime>
169 <activity>
170 <id>1003</id>
171 <name>work time</name>
172 </activity>
173 <terminal>
174 <id>C_32</id>
175 <name>DD-YF 456</name>
176 </terminal>
177 <position>
178 <lat>51.0</lat>
179 <lon>13.1</lon>
180 <address>Am Wüsteberg 3, 01723 Kesselsdorf</address>
181 </position>
182 <area/>
183 <costcenter>
184 <id/>
185 <name/>
186 </costcenter>
187 </booking>
188 <booking>
189 <person>
190 <id/>
191 <key>DF00000001234</key>
192 <name>John Smith</name>
193 <card_nr/>
194 </person>
195 <datetime>2019-04-01 12:35:00</datetime>
196 <activity>
197 <id>1001</id>
198 <name>break</name>
199 </activity>
200 <terminal>
201 <id>C_1</id>
202 <name>central</name>
203 </terminal>
204 <position>
205 <lat>52.3</lat>
206 <lon>11.09</lon>
207 <address>Am Wüsteberg 3, 01723 Kesselsdorf</address>
208 </position>
209 <area/>
210 <costcenter>
211 <id>K-47</id>
212 <name>common</name>
213 </costcenter>
214 </booking>
215 </bookings>{{/code}}
216
217 = Example call =
218
219 **call to output json**
220 {{code language="java"}}https://map.yellowfox.de/rti/get_timerecording.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&start=20190602000000&end=20190605235959&format=JSON{{/code}}
221