Attendance Profile Assignments
Attendance profiles contain attendance policies and control the order in which the system processes the policies and their associated rules.
All employees who have Attendance product licenses assigned are automatically assigned to the empty Attendance profile. This profile is effective dated from the beginning of time until the end of time. After you have created Attendance policies and profiles, assign the employees to the Attendance profiles that you have created.
An employee can be assigned to only one Attendance profile at a time.
You can assign, update, delete, and retrieve details about Attendance profile assignments using operations against the /v1/commons/persons/attendance_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 25 and a person number of 10041.
Example
In this example, we assign, verify, update, and delete a person's Attendance profile assignments.
Create assignments
The same operation is used to both create Attendance profile assignments and to update those assignments.
The create request:
- uses
personIdentity
to identify the person using their person number - uses
attendanceProfileAssignments
to define the Attendance profiles to assign - uses
effectiveDate
paired withprofileName
to define the effective date and specific profile of each assignment
Example request
Call PUT /v1/commons/persons/attendance_profile
with the following request payload.
{
"personIdentity": {
"personNumber": "10041"
},
"attendanceProfileAssignments": [
{
"profileName": "Full Time Employee Profile Perf Att",
"effectiveDate": "2019-05-15"
},
{
"profileName": "Metropolitan Manufacturing",
"effectiveDate": "2019-06-14"
}
]
}
Example response
A success response returns HTTP status code 200 and a response body similar to the following example.
The response returns only the assignments updated in this operation. Other assignments may be present.
{
"attendanceProfileAssignments": [
{
"effectiveDate": "2019-05-15",
"profileName": "Full Time Employee Profile Perf Att"
},
{
"effectiveDate": "2019-06-14",
"profileName": "Metropolitan Manufacturing"
}
],
"personIdentity": {
"personNumber": "10041"
}
}
Verify assignments
To verify, call GET /v1/commons/persons/attendance_profile/{personId}
or GET /v1/commons/persons/attendance_profile?person_number={personNumber}
.
Calling either GET /v1/commons/persons/attendance_profile/25
or /v1/commons/persons/attendance_profile?person_number=10041
returns:
{
"attendanceProfileAssignments": [
{
"effectiveDate": "1753-01-01",
"profileName": "Empty Profile"
},
{
"effectiveDate": "2019-01-01",
"profileName": "Full Time Employee Profile"
},
{
"effectiveDate": "2019-05-15",
"profileName": "Full Time Employee Profile Perf Att"
},
{
"effectiveDate": "2019-06-14",
"profileName": "Metropolitan Manufacturing"
}
],
"personIdentity": {
"personNumber": "10041"
}
}
Update assignments
To update the person's Attendance profile assignments, call PUT /v1/commons/persons/attendance_profile
with the following request payload.
Note: Updating Attendance profile assignments acts like a PATCH operation, allowing you to add additional assignments without erasing old assignments.
Example request
{
"personIdentity": {
"personNumber": "10041"
},
"attendanceProfileAssignments": [
{
"profileName": "Full Time Professional Profile",
"effectiveDate": "2019-09-15"
}
]
}
Example response
A success response returns HTTP status code 200 and a response body similar to the following example.
The response returns only the assignments updated in this operation. Other assignments may be present.
{
"attendanceProfileAssignments": [
{
"profileName": "Full Time Professional Profile",
"effectiveDate": "2019-09-15"
}
],
"personIdentity": {
"personNumber": "10041"
}
}
Delete assignments
To delete all Attendance profile assignments associated with a person, you assign only the Empty Profile using the Update Attendance Profile Assignments operation.
Example request
Call PUT /v1/commons/persons/attendance_profile
with the following request payload.
{
"personIdentity": {
"personNumber":"10041"
},
"attendanceProfileAssignments":[
{
"effectiveDate": "1753-01-01",
"profileName": "Empty Profile"
}
]
}
Example response
A success response returns HTTP status code 200 and a response body similar to the following example.
The response returns only the Empty Profile assigned in this operation. This deletes all other Attendance Profile assignments.
{
"attendanceProfileAssignments": [
{
"profileName": "Full Time Professional Profile",
"effectiveDate": "2019-09-15"
}
],
"personIdentity": {
"personNumber": "10041"
}
}
Verify delete
To verify that assigning the Empty Profile deleted all other assignments, call GET /v1/commons/persons/attendance_profile/{personId}
or GET /v1/commons/persons/attendance_profile?person_number={personNumber}
.
Calling either GET /v1/commons/persons/attendance_profile/25
or /v1/commons/persons/attendance_profile?person_number=10041
now returns:
{
"attendanceProfileAssignments": [
{
"effectiveDate": "1753-01-01",
"profileName": "Empty Profile"
}
],
"personIdentity": {
"personNumber": "10041"
}
}
Updated over 1 year ago