Retrieve employee details and view schedules

In this tutorial, we retrieve employee details and view a schedule.

Retrieve details about an employee

A Timekeeping manager calls the Retrieve Person by ID operation using the GET HTTP method to obtain details about an employee.

  1. Send a GET request to the following URL: https://<<hostName>>/api/v1/commons/persons/<<personId>>
  2. Include the standard Headers.

Example response

{
    "personIdentity": {
        "personKey": 210
    },
    "personInformation": {
        "accessAssignment": {},
        "employmentStatusList": [
            {
                "effectiveDate": "2016-08-13",
                "employmentStatusName": "Active",
                "expirationDate": "3000-01-01"
            }
        ],
        "expectedHoursList": [
            {
                "quantity": 8,
                "timePeriodTypeName": "Daily"
            },
            {
                "quantity": 40,
                "timePeriodTypeName": "Weekly"
            },
            {
                "quantity": 80,
                "timePeriodTypeName": "Pay Period"
            }
        ],
...
}

View an employee schedule

The Timekeeping manager calls the Retrieve Schedule operation using the POST HTTP method to obtain a schedule pertaining to a set of employees. The data included in the response can be specified via the select parameter.

  1. POST a request to the following URL: https://<<hostName>>/api/v1/scheduling/schedule/multi_read
  2. Include the standard Headers.
  3. Include an appropriate JSON call body. Refer to the examples below.

Example request using employees

{
  "where": {
    "excludeBreaks": true,
    "employees": {
      
      "employeeRefs": {
        "ids": [54,55,56,57,58,59]
      },
      "startDate":"2017-05-15",
      "endDate":"2017-07-15"
    }
  }
}

Example response using employees

{
    "shifts": [],
    "payCodeEdits": [],
    "leaveEdits": [],
    "availabilities": [],
    "holidays": [
        {
            "employee": {
                "id": 54
            },
            "holiday": {
                "id": 2,
                "qualifier": "Memorial Day"
            },
            "startDateTime": "2017-05-29T00:00:00",
            "endDateTime": "2017-05-30T00:00:00",
            "posted": false,
            "generated": true,
            "locked": false,
            "deleted": false
        },
        ...
    ],
    "dayLocks": [],
    "employees": [
        {
            "id": 54,
            "qualifier": "20108"
        },
        {
            "id": 55,
            "qualifier": "20109"
        },
        {
            "id": 56,
            "qualifier": "20110"
        },
        {
            "id": 57,
            "qualifier": "20111"
        },
        {
            "id": 58,
            "qualifier": "20112"
        },
        {
            "id": 59,
            "qualifier": "20114"
        }
    ],
    "openShifts": [],
    "scheduleDayList": [
        {
            "employee": {
                "id": 54,
                "qualifier": "20108"
            },
            "hasShift": false,
            "hasHoliday": false,
            "hasPayCodeEdit": false,
            "day": "2017-05-15"
        },
        {
            "employee": {
                "id": 55,
                "qualifier": "20109"
            },
            "hasShift": false,
            "hasHoliday": false,
            "hasPayCodeEdit": false,
            "day": "2017-05-15"
        },
        {
            "employee": {
                "id": 56,
                "qualifier": "20110"
            },
            "hasShift": false,
            "hasHoliday": false,
            "hasPayCodeEdit": false,
            "day": "2017-05-15"
        },
        {
            "employee": {
                "id": 57,
                "qualifier": "20111"
            },
            "hasShift": false,
            "hasHoliday": false,
            "hasPayCodeEdit": false,
            "day": "2017-05-15"
        },
        {
            "employee": {
                "id": 58,
                "qualifier": "20112"
            },
            "hasShift": false,
            "hasHoliday": false,
            "hasPayCodeEdit": false,
            "day": "2017-05-15"
        },
        {
            "employee": {
                "id": 59,
                "qualifier": "20114"
            },
            "hasShift": false,
            "hasHoliday": false,
            "hasPayCodeEdit": false,
            "day": "2017-05-15"
        },
        ...
    ],
    "expandedJobs": [],
    "scheduleTags": []
}

Example request using locations

{
  
  "where": {
    "excludeBreaks": false,
    "locations": {
      "locationRefs": {
        
        "qualifiers": [
          "Organization/Example Hospital/Clin Op/WMNB/Labor/Nurse/RN", 
          "Organization/Example Hospital/Clin Op/WMNB/Labor/Nurse/CN"
        ]
      },
      "symbolicPeriodRef": {
        "qualifier": "current_payperiod",
        "id": 1
      },
      "includeEmployeeTransfer": false
    }
  }
}

Example response using locations

{
    "shifts": [
        {
            "id": 9929,
            "startDateTime": "2018-02-07T19:00:00",
            "endDateTime": "2018-02-08T07:30:00",
            "version": 1503131328875,
            "label": "N12",
            "employee": {
                "id": 320,
                "qualifier": "20011"
            },
            "locked": false,
            "posted": false,
            "generated": true,
            "commentNotes": [],
            "segments": [
                {
                    "id": 29535,
                    "segmentTypeRef": {
                        "id": 1,
                        "qualifier": "REGULAR_SEGMENT"
                    },
                    "startDateTime": "2018-02-07T19:00:00",
                    "endDateTime": "2018-02-08T01:00:00",
                    "transferLaborCategories": false,
                    "orgJobRef": {
                        "id": 441,
                        "qualifier": "Organization/Metropolitan Hospital/Clin Op/WMNB/Labor/Nurse/CN"
                    },
                    "userEnteredOrgJob": false,
                    "transferOrgJob": false,
                    "primaryOrgJobRef": {
                        "id": 441,
                        "qualifier": "Organization/Metropolitan Hospital/Clin Op/WMNB/Labor/Nurse/CN"
                    },
                    "userEnteredCostCenter": false,
                    "transferCostCenter": false,
                    "workruleRef": {
                        "id": 17,
                        "qualifier": "Full Time"
                    },
                    "userEnteredWorkrule": false,
                    "transferWorkrule": false,
                    "primaryWorkruleRef": {
                        "id": 17,
                        "qualifier": "Full Time"
                    },
                    "skillCertProfileRefs": [],
                    "type": "REGULAR_SEGMENT"
                },
                ...
            ],
            "relations": [
                {
                    "targetRef": {
                        "id": 55
                    },
                    "relationType": "FROM_PATTERNITEM_TO_ITEM",
                    "active": true,
                    "from": {
                        "id": 55
                    },
                    "type": "FROM_PATTERNITEM_TO_ITEM"
                },
                {
                    "targetRef": {
                        "id": 59
                    },
                    "relationType": "FROM_SHIFTTEMPLATE_TO_SHIFT",
                    "active": true,
                    "from": {
                        "id": 59
                    },
                    "type": "FROM_SHIFTTEMPLATE_TO_SHIFT"
                }
            ],
            "open": false
        },
        ...
    ],
    "payCodeEdits": [],
    "leaveEdits": [],
    "availabilities": [],
    "holidays": [],
    "dayLocks": [],
    "employees": [
        {
            "id": 320,
            "qualifier": "20011"
        },
        ...
    ],
    "openShifts": [],
    "scheduleDayList": [
        {
            "employee": {
                "id": 410,
                "qualifier": "20105"
            },
            "hasShift": false,
            "hasHoliday": false,
            "hasPayCodeEdit": false,
            "day": "2018-02-05"
        },
        ...
    ],
    "expandedJobs": [],
    "scheduleTags": []
}