Table of contents

    Overview

    Once a staff member is configured with a leave profile and employment type, they should be assigned as set of leave balance objects that relate the staff member to each relevant leave type and the balance of leave hours that they’ve accrued for it. To call the leave balance endpoint, refer to the following table:

    URL GET PUT POST DELETE
    https://api.mypcorp.com/LeaveBalance/
    https://api.mypcorp.com/LeaveBalance/{StaffGuid}

    GET

    The following table illustrates which fields can be included when receiving a GET response.

    CostCentre
    Field Name Description
    StaffGuid
    Guid
    The StaffGuid to for the staff member the entitlement belongs to.
    LeaveType
    string
    Name of the leave type, per 94six settings.
    LeaveCode
    string
    LeaveCode for the leave type, per 94six settings.
    Balance
    decimal
    Value for the staff member’s current accrued leave balance for the type of leave.

    Example JSON response:

    {
        "@odata.context": "https://api.mypcorp.com/$metadata#LeaveBalance",
        "value": [
            {
                "StaffGuid": "a42f65e7-a029-eb11-a824-000d3acb64f8",
                "LeaveType": "Annual leave",
                "LeaveCode": "ANL",
                "Balance": 0.71
            },
            {
                "StaffGuid": "a42f65e7-a029-eb11-a824-000d3acb64f8",
                "LeaveType": "Personal leave",
                "LeaveCode": "PEL",
                "Balance": 0.43
            }
        ]
    }

    PUT

    The following indicates the fields that can be included in PUT requests. To receive a successful response, at least balance object must be provided, and either LeaveType or LeaveCode must be included (both can be included but suggested use is to choose one as the primary identifier and not provide the other). The leave request does not need to specify every leave type assigned to the staff member, any not provided will not be updated. Similarly, new records cannot be added, updates can only be made to existing records.

    Field Description Required
    LeaveType
    string (500)
    Name of the leave type, per 94six settings. Must be provided if LeaveCode is absent. Optional
    LeaveCode
    string (50)
    LeaveCode for the leave type, per 94six settings. Must be provided if LeaveType is absent. Optional
    Balance
    decimal
    Value to set staff member’s leave balance to for the specified leave type Required
    {
      "value": [
        {
            "LeaveType":"Annual Leave",
            "Balance":5
        },
        {
            "LeaveCode":"PaL",
            "Balance":10.5
        },
        {
            "LeaveType":"Time off in lieu",
            "LeaveCode":"TOIL",
            "Balance":20
        }
      ]
    }

    Previous article Next article