Compatibility
This function is intended to be used with timerecording V3
Returns all currently available time recording cost centers.
Description
GET timerecording/get_costcenters.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&format=FORMAT_TYPE
Parameters
parameter | description | type | hint | mandatory |
---|---|---|---|---|
company | RTI company key | string | yes | |
import | RTI import key | string | yes | |
format | output format | string | allowed output formats
Default is csv. | no |
Return values
This function returns a string. On error the return will be "Error:Description".
JSON Format
Returns a JSON formatted text with the properties of each cost center.
Example output
JSON Ausgabe
[{ ident: 'K1001', name: 'Baustelle B', valid_from: '2021-01-01', valid_to: null, planned_duration: 20000, defined_activities: [ { ident: 'A100', duration: 18000 }, { ident: 'A200', duration: 2000 }, { ident: 'A200', duration: null } ], allow_other_activities: 0, defined_persons: [ { id: '2093', name:'Max Mustermann' } ] }]
XML Format
Returns an XML formatted text with the properties of each cost center.
Example output
XML Ausgabe
<?xml version="1.0" encoding="UTF-8"?> <costcenters> <costcenter> <defined_activities> <activity> <duration>18000</duration> <ident>A100</ident> </activity> <activity> <duration>2000</duration> <ident>A200</ident> </activity> <activity> <duration null="true" /> <ident>A200</ident> </activity> </defined_activities> <allow_other_activities>0</allow_other_activities> <ident>K1001</ident> <name>Baustelle B</name> <defined_persons> <person> <id>2093</ident> <name>Max Mustermann</name> </person> </defined_persons> <planned_duration>20000</planned_duration> <valid_from>2021-01-01</valid_from> <valid_to null="true" /> </costcenter> <costcenters>
CSV Format
The CSV format contains one line per cost center. Fields that can contain multiple data records are output as a JSON string.
Meta information
Separator | Semicolon ( ; ) |
---|---|
Delimiter | Double quote ( " ) |
Line break | 0x0D 0x0A (CarriageReturn LineFeed) |
Header | Row 1 |
Encoding | Windows-1252 |
CSV columns
Column | Description | |
---|---|---|
ident | optional self-defined identifier of the cost center | Can be set under cost center basic data. |
name | self-defined name of the cost center | |
valid_from | Date since when this cost center has been active. | Format: YYYY-mm-dd |
valid_to | optional Date until when this cost center is active | Format: YYYY-mm-dd |
planned_duration | optional planned duration of the cost center | in minutes |
defined_activities | optional defined activities for this cost center | Format: JSON string |
allow_other_activities | Option that determines whether other activities can be posted to this cost center in addition to the activities defined. | Format: 0 or 1 |
defined_persons | optional defined persons for this cost center | Format: JSON string |
Example output
"ident";"name";"valid_from"";valid_to";"planned_duration";"defined_activities";"allow_other_activities";"defined_persons" "K1001";"Baustelle B";"2021-01-01";"";"20000";"[{ ident: 'A100', duration: 18000 },{ ident: 'A200', duration: 2000 },{ ident: 'A200', duration: null }]";"0";"[{id:'2093',name:'Max Mustermann'}]" |
Examples
Get cost centers as CSV
https://map.yellowfox.de/rti/timerecording/get_costcenters.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&format=csv