Retrieve Time Cards

You can use the timeRecordGroups resource to get any information on time record groups, such as time cards, absences, or schedules. A manager, for example, wants to get all of the information related to a time card, including statuses, any attached messages, and the time entries with the associated details.

The schema in this figure shows that time record data can flow out of the repository using the time records REST API. Managers 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.

A time card already exists for the worker Tom, for the current week. On Monday through Wednesday, Tom reports time from 09:00 AM to 05:00 PM. On Thursday, he reports time from 09:00 AM to 07:00 PM and on Friday, he reports time from 09:00 AM to 04:30 PM. Tom selects Regular Hours as the payroll time type for each of these entries. One of the time calculation rules associated with Tom calculates any reported time that exceeds 8 hours as overtime. So, on Thursday the rule calculates 8 hours of regular time and 2 hours of overtime for Tom.

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

Configuration Purpose

Manage Time Repository Rules

Define a time calculation rule for all payroll time types based on the delivered template Daily Threshold Template.

Manage Time Repository Rule Sets

Define a time calculation rule set that includes the preceding time calculation rule.

Manage Worker Time Processing Profiles

Define a worker time processing setup profile that includes the preceding time calculation rule set and assign the profile to the worker.

Example URL

The following is the format of the resource URL.

GET

/hcmRestApi/resources/11.13.18.05/timeRecordGroups?finder=filterByPerNumTimeGrp;personNumber=955160008182127,startTime=2017-10-02T00:00:00,stopTime=2017-10-06T23:00:00,groupType=ProcessedTimecard

Example Response

The response to this request delivers all of the information on Tom's current time card. The delivered information includes six entries because the groupType for the request has the value ProcessedTimecard. This groupType value tells the request to retrieve calculated entries as well as reported entries.

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

{
    "items": [
        {
            "timeRecordGroupId": 300100272859779,
            "parentTimeRecordGroupId": null,
            "startTime": "2017-10-02T00:00:00+00:00",
            "stopTime": "2017-10-08T23:59:59.999+00:00",
            "groupType": "Processed Timecard",
            "personNumber": "955160008184353",
            "personId": 300100074978533,
            "comment": null,
            "assignmentNumber": "WFMTLPM047",
            "timeRecordGroupVersion": 1,
            "parentTimeRecordGroupVersion": null,
            "totalHours": 41.5,
            "favoriteName": null,
            "links": [
                {
                    "rel": "self",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordGroups/300100272859779",
                    "name": "timeRecordGroups",
                    "kind": "item"
                },
                {
                    "rel": "canonical",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordGroups/300100272859779",
                    "name": "timeRecordGroups",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordGroups/300100272859779/child/timeMessages",
                    "name": "timeMessages",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordGroups/300100272859779/child/timeStatuses",
                    "name": "timeStatuses",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordGroups/300100272859779/child/timeRecordGroups",
                    "name": "timeRecordGroups",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordGroups/300100272859779/child/timeAttributes",
                    "name": "timeAttributes",
                    "kind": "collection"
                },
                {
                    "rel": "child",
                    "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordGroups/300100272859779/child/timeRecords",
                    "name": "timeRecords",
                    "kind": "collection"
                }
            ]
        }
    ],
    "count": 1,
    "hasMore": false,
    "limit": 25,
    "offset": 0,
    "links": [
        {
            "rel": "self",
            "href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordGroups",
            "name": "timeRecordGroups",
            "kind": "collection"
        }
    ]
}