POST /analytics

Request parameters

ParameterTypeDescription
analyticsFromdateDate from which the analytics results should be considered.
Provide date in ISO-8601 format, eg. 2022-01-01T00:00:00+00:00
analyticsTodateDate until when the analytics results should be considered.
Provide date in ISO-8601 format, eg. 2022-01-31T00:23:59+00:00
exportTypeobjectProvide objects of desired export types which should be delivered as a result.
Possible export types are:
"pdf", "csv" and "json"
pdfobjectObject of pdf export settings.
exportbooleanProvide "true" if you want that the results should be exported via email in pdf format, otherwise provide "false".
employeeAnalyticsbooleanProvide "true" if you want that in the exported pdf document analytics are provided for every employee, otherwise provide "false".
allAnalyticsbooleanProvide "true" if you want that in the exported pdf document analytics are provided as totals for all exported employees, otherwise provide "false".
timeEntriesbooleanProvide "true" if you want that in the exported pdf document time entries are provided for every employee, otherwise provide "false".
csvobjectObject of csv export settings.
exportbooleanProvide "true" if you want that the results should be exported via email in csv format, otherwise provide "false".
csvDelimiterstringDefine the csv delimiter by sending either ";" or "," as value.
jsonobjectObject of json export settings.
exportbooleanProvide "true" if you want that the results should be returned json format, otherwise provide "false".
recipientEmailsarray [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.
emailMessagestringProvide an email text message if desired.
userIdsarray [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.
organizationIdsarray [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.
subOrganizationsbooleanProvide "true" if you want that the results should consider all child organizations from the selected "organizationIds", otherwise provide "false".
approvalStatusesarray [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.
timeTypesarray [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

CodeTitleDescription
200 SuccessReturned if request was successful.
400Bad RequestReturned if request was bad.
401UnauthorizedReturned if request was not authorized (eg. due to bad API key).
404Not FoundReturned 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
                    } ]
        }
}