POST /analytics
Request parameters
Parameter | Type | Description |
---|---|---|
analyticsFrom | date | Date from which the analytics results should be considered. Provide date in ISO-8601 format, eg. 2022-01-01T00:00:00+00:00 |
analyticsTo | date | Date until when the analytics results should be considered. Provide date in ISO-8601 format, eg. 2022-01-31T00:23:59+00:00 |
exportType | object | Provide objects of desired export types which should be delivered as a result. Possible export types are: "pdf", "csv" and "json" |
object | Object of pdf export settings. | |
export | boolean | Provide "true" if you want that the results should be exported via email in pdf format, otherwise provide "false". |
employeeAnalytics | boolean | Provide "true" if you want that in the exported pdf document analytics are provided for every employee, otherwise provide "false". |
allAnalytics | boolean | Provide "true" if you want that in the exported pdf document analytics are provided as totals for all exported employees, otherwise provide "false". |
timeEntries | boolean | Provide "true" if you want that in the exported pdf document time entries are provided for every employee, otherwise provide "false". |
csv | object | Object of csv export settings. |
export | boolean | Provide "true" if you want that the results should be exported via email in csv format, otherwise provide "false". |
csvDelimiter | string | Define the csv delimiter by sending either ";" or "," as value. |
json | object | Object of json export settings. |
export | boolean | Provide "true" if you want that the results should be returned json format, otherwise provide "false". |
recipientEmails | array [string] | Provide an array of email addresses to whom the pdf or csv exported files should be delivered. Mandatory if "export" for "pdf" or "csv" is true. |
emailMessage | string | Provide an email text message if desired. |
userIds | array [string] | Provide an array of user id's for those users which time entries should be considered for the analytics data. If empty, then all users that authenticated user is allowed to see will be considered. |
organizationIds | array [string] | Provide an array of organization id's for those organizations which time entries should be considered for the analytics data. If empty, then all groups that authenticated user is allowed to see will be considered. |
subOrganizations | boolean | Provide "true" if you want that the results should consider all child organizations from the selected "organizationIds", otherwise provide "false". |
approvalStatuses | array [string] | If provided only time entries with this specific approvalStatus(es) will be returned. Possible query parameters: "disapproved", "not_approved_yet", "under_approval", "approved", "exported" If empty all statuses will be considered. |
timeTypes | array [string] | If provided only time entries with this specific timeType(s) will be returned. Possible query parameters: "work", "parental_leave", "worked_rest_period", "clocking", "statutory_leave", "public_holiday_abroad", "medical_leave", "bad_weather", "company_vacation", "unpaid_vacation", "care_leave", "out_office", "work_accident_sickness", "military_exercize", "flextime", "unpaid_time_off", "home_office", "study_leave", "paid_time_off", "other_leave", "vacation_abroad", "travel", "sick", "military_service", "jubilee_day", "vacation", "move", "special_leave", "free_time" If empty all statuses will be considered. |
Request JSON example
{
"analyticsFrom": "2022-04-01T00:00:00+03:00",
"analyticsTo": "2022-04-30T00:00:00+03:00",
"exportType":
{
"pdf": {
"export": true,
"employeeAnalytics": true,
"allAnalytics": true,
"timeEntries": true
},
"csv": {
"export": false,
"csvDelimiter": ";"
},
"json": {
"export": true
}
},
"recipientEmails": [
"[email protected]"
],
"emailMessage": "Test Email Message",
"userIds": [],
"organizationIds": [
"87654321-dcba-6789-2345-98klmnopqrst",
"12345678-abcd-9876-5432-10abcdefghij"
],
"subOrganizations": "true",
"approvalStatuses": [],
"timeTypes": []
}
Responses
Code | Title | Description |
---|---|---|
200 | Success | Returned if request was successful. |
400 | Bad Request | Returned if request was bad. |
401 | Unauthorized | Returned if request was not authorized (eg. due to bad API key). |
404 | Not Found | Returned if request could not be found. |
Info
The response values and totals are returned in milliseconds.
Response JSON example if exportType "json" is "true:
{
"totals":
{
"productive": {
"normalTime": 3600000,
"additionalTime": 3600000,
"breaks": 0,
"total": 7200000
},
"unproductive": {
"vacations": 3600000,
"sickLeaves": 3600000,
"paidAbsences": 3600000,
"unpaidAbsences": 3600000,
"total": 14400000
},
"targetTimes": {
"current": 3600000,
"productive": 3600000,
"total": 7200000
},
"targetTimeDifferences": {
"positive": 3600000,
"positiveCurrent": 3600000,
"negative": 3600000,
"negativeCurrent": 3600000,
"totalCurrent": 3600000,
"total": 7200000
},
"incompleteness": {
"submittedTimeEntries": 15,
"missingTimeEntries": 25,
"total": 40
},
"organizations": [
{
"id": "12345678-abcd-9876-5432-10abcdefghij",
"name": "Project ABC",
"total": 3600000
},
{
"id": "87654321-dcba-6789-2345-98klmnopqrst",
"name": "Client ABC",
"total": 3600000
} ]
}
}