TeleStaff Profile Assignments - Aggregated

A series of TeleStaff profile assignment examples are provided in this topic. The employee passed in must be a valid TeleStaff employee.

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 TeleStaff profile assignments.

Create or update assignments

The create or update request:

  • uses personIdentity to identify the person using their person number
  • uses telestaffAssignment inside personAssignments to define the TeleStaff profile to assign

Example request

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

[
    {
        "personIdentity": {
            "personNumber": "1600436"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "personTeleStaffAssignment": {
                    "badgeId": "123",
                    "seniorityNumber": "2.00"
                }
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "2600831"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "personTeleStaffAssignment": {
                    "badgeId": "321",
                    "seniorityNumber": "2.00"
                }
            }
        }
    }
] }
]

Example response

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

[
    {
        "personIdentity": {
            "personNumber": "1600436"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "personTeleStaffAssignment": {
                    "badgeId": "123",
                    "seniorityNumber": "2.00"
                }
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "2600831"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "personTeleStaffAssignment": {
                    "badgeId": "321",
                    "seniorityNumber": "2.00"
                }
            }
        }
    }
]

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": [
        "1600436", "2600831"
      ]
    },
    "personAssignments": [
    "telestaffAssignment"
  ]
  }
}

Example response

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

[
    {
        "personIdentity": {
            "personNumber": "1600436"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "personTeleStaffAssignment": {
                    "badgeId": "123",
                    "seniorityNumber": "2.00"
                }
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "2600831"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "personTeleStaffAssignment": {
                    "badgeId": "321",
                    "seniorityNumber": "2.00"
                }
            }
        }
    }
]

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 TeleStaff profile assignments.

In the following example, the system makes no changes. Setting a null and passing the 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": {
            "telestaffAssignment": {
                "personTeleStaffAssignment":null
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10030"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "unAssignExisting":false
            }
        }
    }
]

Example response

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

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

Delete assignments

You can delete, or unassign, TeleStaff profile assignments. To delete our example's TeleStaff 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": "10020"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "unAssignExisting":true
            }
        }
    },
    {
        "personIdentity": {
            "personNumber": "10030"
        },
        "personAssignments": {
            "telestaffAssignment": {
                "unAssignExisting":true
            }
        }
    }
]

Example response

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

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

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.