Leave Administrator Assignments

You can assign an administrator to a Leave employee. The employee passed in must be a valid Leave employee. The administrator passed in must be a valid Timekeeper manager.

You can assign, update, delete, and retrieve details about Leave administrator assignments using operations against the /v1/commons/persons/leave_admin 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 250 and a person number of 90118.

Example

In this example, we assign, verify, update, and delete a person's Leave administrator assignments.

Create the assignment

The create request:

  • uses personIdentity to identify the person using their person key
  • uses administrator to define the Timekeeper manager to assign as a Leave administrator
  • uses effectiveDate to define the effective date of the assignment

Example request

Call PUT /v1/commons/persons/leave_admin with the following request payload.

{
    "personIdentity": {
        "personKey": "250"
     },
     "administrator": {
        "personNumber":"30165",
        "effectiveDate": "2020-02-20"
    }
}

Example response

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

{
    "administrator": {
        "displayName": "(30165)",
        "effectiveDate": "2020-02-20",
        "personNumber": "30165"
    },
    "personidentity": {
        "personKey": 250
    }
}

Verify the assignment

To verify, you can call GET /v1/commons/persons/leave_admin/{personId} or GET /v1/commons/persons/leave_admin?person_number={personNumber}.

Calling either GET /v1/commons/persons/leave_admin/250 or /v1/commons/persons/leave_admin?person_number=90118 returns:

{
    "administrator": {
        "displayName": "Morgan, Andy (30165)",
        "fullName": "Morgan, Andy",
        "personNumber": "30165"
    },
    "personidentity": {
        "personNumber": "90118"
    }
}

Update the assignment

To update the person's Leave administrator assignment, call PUT /v1/commons/persons/leave_admin with the following request payload.

Example request

{
    "personIdentity":{
        "personNumber":"90118"
    },
        "administrator":{
        "personNumber":"30105",
        "effectiveDate": "2020-06-01"
    }
}

Example response

{
    "administrator": {
        "displayName": "(30105)",
        "effectiveDate": "2020-06-01",
        "personNumber": "30105"
    },
    "personidentity": {
        "personNumber": "90118"
    }
}

Delete an assignment

To delete a Leave administrator assignment associated with a person, call DELETE /commons/persons/leave_admin with the following request payload.

{
  "personIdentity": {
    "personNumber": "90118"
  },
  "administrator": {
    "personNumber": "30105"
  }
}

The system returns HTTP status 204 with no response body.