GET /times
Request parameters
Parameter | Type | Description |
---|---|---|
userIds | array [string] | If provided only time entries from this user(s) will be returned. If not provided all user(s) which authenticated user is allowed to see will be retrieved. If id is provided which authenticated user is not allowed to see, then 401 code will be returned. |
from (mandatory) | date | Time entries that started after the specified date and time will be returned. Send date and time in ISO-8601 format containing a timezone, eg. 2022-04-25T08:00:00%2B03:00 Plus signs [ + ] should be encoded to [ %2B ] |
to (mandatory) | date | Time entries that started before the specified date and time will be returned. Send date and time in ISO-8601 format containing a timezone, eg. 2022-04-25T18:00:00%2B03:00 Plus signs [ + ] should be encoded to [ %2B ] Maximum allowed timespan are 366 days. |
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" |
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" |
organizationNames | array [string] | If provided only time entries saved in this specific organizationName(s) will be returned. If not provided all time entries within all organization units will be retrieved which authenticated user is allowed to see. If provided together with organizationIds then organizationNames will be ignored. If name is provided which authenticated user is not allowed to see, then 401 code will be returned. |
organizationIds | array [string] | If provided only time entries saved in this specific organizationId(s) will be returned. If not provided all time entries within all organization units will be retrieved which authenticated user is allowed to see. If id is provided which authenticated user is not allowed to see, then 401 code will be returned. |
page | integer (default 1) | Decide which page should be returned. Note: Maximum of 20 users will be returned per page. |
Request example:
https://mctime.com/api/v2/auth/times?from=2022-04-25T08:00:00%2B03:00&to=2022-04-25T18:00:00%2B03:00&timeTypes=work&timeTypes=vacation
//All time entries within the from-to dates and which authenticated user is allowed to see and which have "work" OR "vacation" as timeType will be returned.
https://mctime.com/api/v2/auth/times?from=2022-04-25T08:00:00%2B03:00&to=2022-04-25T18:00:00%2B03:00&userIds=123&userIds=987
//All time entries within the from-to dates from users 123 and 987 will be returned if authenticated user is allowed to view time entries from those users.
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. |
Users permissions will be considered
The response will consider the permissions of the user who is authenticated by the API call and will only return time entries which user is allowed to see.
Response JSON example:
{
"items": [
{
"message": "Success",
"data": {
"timeEntries": [
{
"userId": "993ea1fb-ae4a-422e-9e90-5ecdbb1afb7f",
"userName": "John Doe",
"userFirstName": "John",
"userLastName": "Doe",
"times": [
{
"id": "5a61239c-e1b0-46bd-aefb-310e43bb1dac",
"from": "2022-04-22T10:40:00+03:00",
"to": "2022-04-22T18:40:00+03:00",
"breaks": [
{
"id": "59876501-5c90-467e-a4d4-b86ad14a5dcb",
"from": "2022-04-22T12:00:00+03:00",
"to": "2022-04-22T12:30:00+03:00",
"automatic": false //true or false if autmatic breaks were saved through target times.
}
],
"comment": "Test Comment",
"type": "work",
"organizationId": "c885abc9-55fe-4019-9846-54bfaa94ec10",
"organizationName": "Test Project",
"approvalStatus": "approved", //approval status of time entry, possible responses "disapproved", "not_approved_yet", "under_approval", "approved", "exported"
"creationType": "clock" //possible responses "times", "clock", "wtm" or "null". "times" will be returned if time entry was saved manually with from-to times. "clock" will be returned if time entry was clocked. "wtm" will be returned if time entry was saved automatically via the working time model. "null" will be returned if time entry was edited.
},
{
"id": "10671242-5713-40da-9434-8046aa45f732",
"from": "2022-04-25T09:15:00+03:00",
"to": "2022-04-25T17:30:00+03:00",
"breaks": [],
"comment": "Another Comment",
"type": "vacation",
"organizationId": "cabcdde9-55fe-4019-9846-54bfaa94ec10",
"organizationName": "My Company",
"approvalStatus": "approved", //approval status of time entry, possible responses "disapproved", "not_approved_yet", "under_approval", "approved", "exported"
"creationType": "times" //possible responses "times", "clock", "wtm" or "null". "times" will be returned if time entry was saved manually with from-to times. "clock" will be returned if time entry was clocked. "wtm" will be returned if time entry was saved automatically via the working time model. "null" will be returned if time entry was edited.
}
]
}
],
"page": "1", //currently returned page
"pageSize": "15" //total number of pages
}
}
],
"valid": true
}