Retrieve Time Entries

You can use the timeRecords resource to get any information on time records, such as time entries, absence entries, or schedule shifts. The following example shows how to get all time entries reported by a worker during the work week, including start and stop times, pay attributes, and any messages attached to entries.

The schema in this figure shows that time record data can flow out of the repository using the time records REST API. Managers, for example, can get time record information and then use it to clear exceptions, for example, updating time entries, or allowing related exceptions.

This figure describes the data transfer between the Time and Labor application and the manager.

The worker Tom clocks in and out at 09:00 AM and 05:00 PM on Monday through Thursday of the current week. He clocks in and out on Friday at 09:00 AM and 04:30 PM. Then, the Generate Time Cards from Time Collection Devices process generates a time card using these events. The generated time card entries for Monday through Thursday are from 09:00 AM to 05:00 PM, with the Regular Hours payroll time type. On Friday, the time card entry is from 09:00 AM to 04:30 PM with the Regular Hours payroll time type.

This table shows the prerequisite Time and Labor configuration required to support this scenario.

Configuration Purpose

Manage Time Device Mappings

Define 2 mappings for in and out punches.

Manage Time Device Mapping Sets

Define a time device mapping set that includes the preceding mappings.

Manage Worker Time Device Processing Profiles

Define a worker time device processing profile that includes the preceding mapping set and assign the profile to the worker.

Example URL

The following is the format of the resource URL.

GET

/hcmRestApi/11.13.18.05/timeRecords?finder=filterByPerNumTimeGrp;personNumber=955160008182127,startTime=2017-10-02T07:00:00,stopTime=2017-10-06T23:00:00,groupType=TimeCardEntry

Example Response

The response to this request delivers Tom's five reported time entries and their corresponding details.

The following is an example of the response body in JSON format.

{
    "items": [
        {
            "timeRecordId": 300100272859766,
            "timeRecordGroupId": 300100272859765,
            "startTime": "2017-10-02T09:00:00+00:00",
            "stopTime": "2017-10-02T17:00:00+00:00",
            "groupType": "TimecardEntry",
            "recordType": "RANGE",
            "measure": 8,
            "unitOfMeasure": "Hours",
            "personNumber": "955160008184353",
            "personId": 300100074978533,
            "comment": null,
            "assignmentNumber": "WFMTLPM047",
            "timeRecordGroupVersion": 1,
            "timeRecordVersion": 1,
            "overtimeDate": null,
            "earnedDate": "2017-10-02",
            "links": [
                {
                    "rel": "self",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859766",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "canonical",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859766",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859766/child/timeMessages",
                    "name": "timeMessages",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859766/child/timeStatuses",
                    "name": "timeStatuses",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859766/child/timeAttributes",
                    "name": "timeAttributes",
                    "kind": "collection"
                }
            ]
        },
        {
            "timeRecordId": 300100272859769,
            "timeRecordGroupId": 300100272859768,
            "startTime": "2017-10-03T09:00:00+00:00",
            "stopTime": "2017-10-03T17:00:00+00:00",
            "groupType": "TimecardEntry",
            "recordType": "RANGE",
            "measure": 8,
            "unitOfMeasure": "Hours",
            "personNumber": "955160008184353",
            "personId": 300100074978533,
            "comment": null,
            "assignmentNumber": "WFMTLPM047",
            "timeRecordGroupVersion": 1,
            "timeRecordVersion": 1,
            "overtimeDate": null,
            "earnedDate": "2017-10-03",
            "links": [
                {
                    "rel": "self",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859769",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "canonical",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859769",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859769/child/timeMessages",
                    "name": "timeMessages",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859769/child/timeStatuses",
                    "name": "timeStatuses",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859769/child/timeAttributes",
                    "name": "timeAttributes",
                    "kind": "collection"
                }
            ]
        },
        {
            "timeRecordId": 300100272859771,
            "timeRecordGroupId": 300100272859770,
            "startTime": "2017-10-04T09:00:00+00:00",
            "stopTime": "2017-10-04T17:00:00+00:00",
            "groupType": "TimecardEntry",
            "recordType": "RANGE",
            "measure": 8,
            "unitOfMeasure": "Hours",
            "personNumber": "955160008184353",
            "personId": 300100074978533,
            "comment": null,
            "assignmentNumber": "WFMTLPM047",
            "timeRecordGroupVersion": 1,
            "timeRecordVersion": 1,
            "overtimeDate": null,
            "earnedDate": "2017-10-04",
            "links": [
                {
                    "rel": "self",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859771",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "canonical",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859771",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859771/child/timeMessages",
                    "name": "timeMessages",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859771/child/timeStatuses",
                    "name": "timeStatuses",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859771/child/timeAttributes",
                    "name": "timeAttributes",
                    "kind": "collection"
                }
            ]
        },
        {
            "timeRecordId": 300100272859773,
            "timeRecordGroupId": 300100272859772,
            "startTime": "2017-10-05T09:00:00+00:00",
            "stopTime": "2017-10-05T17:00:00+00:00",
            "groupType": "TimecardEntry",
            "recordType": "RANGE",
            "measure": 8,
            "unitOfMeasure": "Hours",
            "personNumber": "955160008184353",
            "personId": 300100074978533,
            "comment": null,
            "assignmentNumber": "WFMTLPM047",
            "timeRecordGroupVersion": 1,
            "timeRecordVersion": 1,
            "overtimeDate": null,
            "earnedDate": "2017-10-05",
            "links": [
                {
                    "rel": "self",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859773",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "canonical",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859773",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859773/child/timeMessages",
                    "name": "timeMessages",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859773/child/timeStatuses",
                    "name": "timeStatuses",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859773/child/timeAttributes",
                    "name": "timeAttributes",
                    "kind": "collection"
                }
            ]
        },
        {
            "timeRecordId": 300100272859775,
            "timeRecordGroupId": 300100272859774,
            "startTime": "2017-10-06T09:00:00+00:00",
            "stopTime": "2017-10-06T16:30:00+00:00",
            "groupType": "TimecardEntry",
            "recordType": "RANGE",
            "measure": 7.5,
            "unitOfMeasure": "Hours",
            "personNumber": "955160008184353",
            "personId": 300100074978533,
            "comment": null,
            "assignmentNumber": "WFMTLPM047",
            "timeRecordGroupVersion": 1,
            "timeRecordVersion": 1,
            "overtimeDate": null,
            "earnedDate": "2017-10-06",
            "links": [
                {
                    "rel": "self",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859775",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "canonical",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859775",
                    "name": "timeRecords",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859775/child/timeMessages",
                    "name": "timeMessages",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859775/child/timeStatuses",
                    "name": "timeStatuses",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords/300100272859775/child/timeAttributes",
                    "name": "timeAttributes",
                    "kind": "collection"
                }
            ]
        }
    ],
    "count": 5,
    "hasMore": false,
    "limit": 25,
    "offset": 0,
    "links": [
        {
            "rel": "self",
            "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecords",
            "name": "timeRecords",
            "kind": "collection"
        }
    ]
}