Attendance Profile Assignments - Aggregated

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.

Prerequisites

A person ID is the same identifier as personKey and employee ID, and is not the same as a person number.

Example

In this example, we assign, verify, delete, and pass a request that makes no change to multiple people's Attendance profile assignments.

Create or update assignments

The create or update request:

  • uses personIdentity to identify the person using their person number
  • uses attendanceProfile inside personAssignments to define the Attendance profiles to assign

Example request

Call POST /v1/commons/persons/assignments/multi_upsert with the following request payload.

[
    {
        "personIdentity": {
            "personNumber": "10032"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments": [
                     
                    {
                        "effectiveDate": "2019-04-18",
                        "profileName": "Full Time Employee Profile"
                    }
                ]
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10033"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments": [
                     
                    {
                        "effectiveDate": "2019-04-18",
                        "profileName": "Full Time Employee Profile"
                    }
                ]
            }
        }
    }
]

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

[
    {
        "personIdentity": {
            "personNumber": "10032"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments": [
                    {
                        "effectiveDate": "2019-04-18",
                        "profileName": "Full Time Employee Profile"
                    }
                ]
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10033"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments": [
                    {
                        "effectiveDate": "2019-04-18",
                        "profileName": "Full Time Employee Profile"
                    }
                ]
            }
        }
    }
]

Verify assignments

You can use the bulk multi-read operation to verify assignments for multiple people at once.

Example request

To verify, call POST /v1/commons/persons/assignments/multi_read with the following request payload.

{
  "where": {
    "employees": {
      "key": "personNumber",
      "values": [
        "10032", "10033"
      ]
    },
    "personAssignments": [
    "attendanceProfile"
  ]
  }
}

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

[
    {
        "personIdentity": {
            "personNumber": "10032"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments": [
                    {
                        "effectiveDate": "1753-01-01",
                        "profileName": "Empty Profile"
                    },
                    {
                        "effectiveDate": "2017-04-18",
                        "profileName": "Full Time Employee Profile"
                    }
                ]
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10033"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments": [
                    {
                        "effectiveDate": "1753-01-01",
                        "profileName": "Empty Profile"
                    },
                    {
                        "effectiveDate": "2017-04-18",
                        "profileName": "Full Time Employee Profile"
                    }
                ]
            }
        }
    }
]

Make no change to assignments

When working with large numbers of people, you may wish to pass a request payload that makes no changes to a person's Attendance profile assignments.

In the following example, the system makes no changes. Setting a null attendanceProfileAssignments and passing the unAssignExisting Boolean as false both result in no changes to a person's assignments.

Example request

Call POST /v1/commons/persons/assignments/multi_upsert with the following request payload.

[
    {
        "personIdentity": {
            "personNumber": "10020"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments":null
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10030"
        },
        "personAssignments": {
            "attendanceProfile": {
                "unAssignExisting":false
            }
        }
    }
]

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

[
    {
        "personIdentity": {
            "personNumber": "10020"
        },
        "personAssignments": {
            "attendanceProfile": {}
        }
    },
    {
        "personIdentity": {
            "personNumber": "10030"
        },
        "personAssignments": {
            "attendanceProfile": {}
        }
    }
]

Delete assignments

You can delete, or unassign, Attendance profile assignments. To delete our example's Attendance profile assignments, call POST /v1/commons/persons/assignments/multi_upsert using the unAssignExisting property.

Example request

Call POST /v1/commons/persons/assignments/multi_upsert with the following request payload.

[
    {
        "personIdentity": {
            "personNumber": "10032"
        },
        "personAssignments": {
            "attendanceProfile": {
                "unAssignExisting": true
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10033"
        },
        "personAssignments": {
            "attendanceProfile": {
                "unAssignExisting": true
                
            }
        }
    }
]

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

[
    {
        "personIdentity": {
            "personNumber": "10032"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments": [
                    {
                        "effectiveDate": "1753-01-01",
                        "profileName": "Empty Profile"
                    }
                ]
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10033"
        },
        "personAssignments": {
            "attendanceProfile": {
                "attendanceProfileAssignments": [
                    {
                        "effectiveDate": "1753-01-01",
                        "profileName": "Empty Profile"
                    }
                ]
            }
        }
    }
]

Note: You can verify that the assignments were deleted by calling POST /v1/commons/persons/assignments/multi_read with a request payload specifying all of the affected person identities.