Leave Profile Assignments
Leave Profiles are the collection of allowed Leave Categories and associated Leave Types, Leave Rules, Eligibility Requirements and Configurable Fields. Leave Profiles are assigned to licensed employees.
Note: Leave Reasons are not a part of Leave Profiles. All Leave Reasons are available to all employees.
You can assign, update, delete, and retrieve details about Leave Profile assignments using operations against the /v1/commons/persons/leave_profile
resource.
Prerequisites
A person's person ID is the same as the personKey
and employee ID, and is not the same as the person number.
The person in this example has a person ID of 100 and a person number of 20190.
Example
In this example, we retrieve a list of available Leave Profiles and then assign, verify, update, and delete a person's Leave Profile assignments.
Retrieve available Leave Profiles
Call GET /v1/leave/leave_profiles
to retrieve a list of all available Leave Profiles. The response returned will resemble the example below. This example shows the basic format of the response model, but is shortened due to the size of a standard Leave Profile. The leaveProfileCategory
object is truncated in the response.
[
{
"id": 11,
"isActive": true,
"leaveProfileCategory": [
{
"id": 3,
"qualifier": "Self",
"leaveProfileCategoryConfigurableData": [...
],
"leaveProfileCategoryRule": [...
],
"leaveProfileCategoryType": [...
]
},...
],
"qualifier": "California Leave"
},
{
"id": 59,
"isActive": true,
"leaveProfileCategory": [
{
"id": 51,
"qualifier": "Military Duty-Retail",
"leaveProfileCategoryConfigurableData": [],
"leaveProfileCategoryRule": [...
],
"leaveProfileCategoryType": [...
]
},...
],
"qualifier": "California Leave-Retail"
},
...
]
Create the assignment
The create request:
- uses
personIdentity
to identify the person using their person number - uses
assignmentProfile
to define the Leave Profile to assign
Example request
Call PUT /v1/commons/persons/leave_profile
with the following request payload.
{
"personIdentity": {
"personNumber": "20190"
},
"assignmentProfile": "Hawaii Leave"
}
Example response
A success response returns HTTP status code 200 and a response body similar to the following example.
{
"assignmentProfile": "Hawaii Leave",
"personIdentity": {
"personNumber": "20190"
}
}
Verify the assignment
To verify, you can call GET /v1/commons/persons/leave_profile?person_number={personNumber}
or GET /v1/commons/persons/leave_profile/{personId}
.
Calling GET /v1/commons/persons/leave_profile?person_number=20190
or GET /v1/commons/persons/leave_profile/100
returns:
{
"assignmentProfile": "Hawaii Leave",
"personIdentity": {
"personNumber": "20190"
}
}
Update the assignment
To update the person's attestation assignments, call PUT /v1/commons/persons/leave_profile
with the following request payload.
Example request
{
"personIdentity": {
"personNumber": "20190"
},
"assignmentProfile": "California Leave"
}
Example response
{
"assignmentProfile": "California Leave",
"personIdentity": {
"personNumber": "20190"
}
}
Delete an assignment
To delete a Leave Profile assignment associated with a person, call DELETE /v1/commons/persons/leave_profile
with the following request payload.
{
"personIdentity": {
"personNumber": "20190"
},
"assignmentProfile": "California Leave"
}
The system returns HTTP status 204 with no response body.
Updated over 1 year ago