Last modified by YellowFox_RD on 2024/12/19 10:11

Hide last authors
YellowFox_RD 1.1 1 (% class="box" %)
Dominic Lippmann 2.1 2 (((Table of Contents)))
YellowFox_RD 1.1 3 {{toc/}}
4
5 (% class="box" %)
6 (((
Dominic Lippmann 2.1 7 **Compatibility
8 **This function is intended to be used with timerecording V3
YellowFox_RD 1.1 9 )))
10
Dominic Lippmann 2.1 11 Returns all currently available time recording activities.
12 = Description =
13 **(% class="green mark" %)GET(%%)// timerecording/get_activities.php?company//**//=COMPANY_RTIKEY**&import**=COMPANY_IMPORTKEY**&format**=FORMAT_TYPE//
14 = Parameters =
15 |=Parameter|=Description|=Type|=Note|=Mandatory
16 |company|RTI company key|string||yes
17 |import|RTI import key|string||yes
18 |format|output format|string|allowed output formats
YellowFox_RD 1.1 19 (((
20 * csv
21 * json
22 * xml
23 )))
Dominic Lippmann 2.1 24 Default is csv.|no
YellowFox_RD 1.1 25
Dominic Lippmann 2.1 26 = Return values =
27 This function returns a **string**. On error the return will be "**Error:Description**".
YellowFox_RD 1.1 28 == JSON Format ==
Dominic Lippmann 2.1 29 Returns a JSON formatted text with the properties of each activity.
30 === Example output ===
31 **json output**
YellowFox_RD 1.1 32 {{code language="js"}}[
33 {
34 ident: 'A100',
35 name: 'Arbeiten',
36 color: 'CC0000',
37 is_worktime: 1,
38 is_standbytime: 0
39 },
40 {
41 ident: 'A200',
42 name: 'Fahren',
43 color: '00CC00',
44 is_worktime: 1,
45 is_standbytime: 0
46 },
47 {
48 ident: 'P100',
49 name: 'Pause',
50 color: '0000CC',
51 is_worktime: 0,
52 is_standbytime: 0
53 },
54 {
55 ident: 'B100',
56 name: 'Bereitschaft',
57 color: '0000CC',
58 is_worktime: 0,
59 is_standbytime: 1
60 }
61 ]{{/code}}
62
63 == XML Format ==
Dominic Lippmann 2.1 64 Returns an XML formatted text with the properties of each activity.
65 === Example output ===
66 **xml output**
YellowFox_RD 1.1 67 {{code language="xml"}}<?xml version="1.0" encoding="UTF-8"?>
68 <activities>
69 <activity>
70 <color>CC0000</color>
71 <ident>A100</ident>
72 <is_standbytime>0</is_standbytime>
73 <is_worktime>1</is_worktime>
74 <name>Arbeiten</name>
75 </activity>
76 <activity>
77 <color>00CC00</color>
78 <ident>A200</ident>
79 <is_standbytime>0</is_standbytime>
80 <is_worktime>1</is_worktime>
81 <name>Fahren</name>
82 </activity>
83 <activity>
84 <color>0000CC</color>
85 <ident>P100</ident>
86 <is_standbytime>0</is_standbytime>
87 <is_worktime>0</is_worktime>
88 <name>Pause</name>
89 </activity>
90 <activity>
91 <color>0000CC</color>
92 <ident>B100</ident>
93 <is_standbytime>1</is_standbytime>
94 <is_worktime>0</is_worktime>
95 <name>Bereitschaft</name>
96 </activity>
97 </activities>{{/code}}
98
99 == CSV Format ==
Dominic Lippmann 2.1 100 The CSV format contains one line per activity. Fields that can contain multiple data records are output as a JSON string.
101 === Meta information ===
102 |=Separator|Semicolon ( ; )
103 |=Delimiter|Double quote ( " )
104 |=Line break|0x0D 0x0A (CarriageReturn LineFeed)
105 |=Header|Row 1
106 |=Encoding|Windows-1252
YellowFox_RD 1.1 107
Dominic Lippmann 2.1 108 === CSV columns ===
109 |=Column|=Description|=
110 |ident|//optional// self-defined identifier of the activity|Can be set under Timerecording> Settings> Activities
111 The standard activity "End span" always has an "ident" of "0".
112 |name|self-defined name of the activity|
113 |color|self-defined color of the activity|Format: hexadecimal
114 The standard activity "Leaving" has no color.
115 |is_worktime|Option whether this activity is part of a working time or not.|Possible values: 0 or 1
116 |is_standbytime|Option whether this activity is part of a standby time or not.|Possible values: 0 or 1
YellowFox_RD 1.1 117
Dominic Lippmann 2.1 118 === Example output ===
119 **output in CSV**
YellowFox_RD 1.1 120 {{code language="java"}}"ident";"name";"color";"is_worktime";"is_standbytime"
121 "A100";"Arbeiten";"CC0000";"1";"0"
122 "A200";"Fahren";"00CC00";"1";"0"
123 "P100";"Pause";"0000CC";"0";"0"
124 "B100";"Bereitschaft";"0000CC";"0";"1"{{/code}}
125
Dominic Lippmann 2.1 126 = Example call =
127 **Retrieval of bookings in CSV format**
YellowFox_RD 1.1 128 {{code language="java"}}https://map.yellowfox.de/rti/timerecording/get_activities.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&format=csv{{/code}}
129