There are four new endpoints available in the People API Subscription that enable searching for Employees or Assignments based on alternate identifiers. Previously, the only ID available to use in requests was the ID that was assigned to a record by AssignmentPro; while this is still the case, the introduction of these additional endpoints provide a clear entry point to core domains to easily cross reference an alternative ID to discover the AssignmentPro ID and use for subsequent requests.
To Search for Assignments based on From Employee ID
The AssignmentPro ID for Assignments can be found based on the value of From Employee ID by making a GET request to the following endpoint:
api/search/assignment/byFromEmployeeId
The value of From Employee ID to search against is provided as a query string parameter appended to the endpoint. If the From Employee ID to search for is ABC123, the request would look like the below:
api/search/assignment/byFromEmployeeId?search=ABC123
The response will then return the full Assignment data object for any Assignments which match the provided search criteria. Since the response includes the โidโ data element, which is the AssignmentPro ID that will be expected for PATCH or DELETE requests, it can be retained and used for subsequent requests to the API for further interaction with those records.
The usage guidance above will be the same for all additional search endpoints following this pattern, and additional details can be found by viewing API Documentation via logging in to AssignmentPro as an API Subscriber user.
To Search for Assignments based on To Employee ID
api/search/assignment/byToEmployeeId
Same guidance as above applies. Provide the search criteria as a query string parameter.
To Search for Assignments based on Number
api/search/assignment/byNumber
Same guidance as above applies. Provide the search criteria as a query string parameter.
To Search for Employees based on System Number
api/search/employee/bySystemNumber
Same guidance as above applies. Provide the search criteria as a query string parameter.
General Considerations
All four of these alternate identifiers support special characters, most of which have been reviewed and can be provided in the query string parameters without any encoding considerations. If requests to the API fail, try encoding special characters before making the request.
Even if no results are found, the API will still return a 200 OK response, with an empty Data array.
Only some of these alternate identifiers have requirements in the system to be unique; if multiple records are found that match the provided search criteria, they will be returned in the response.
This enhancement only supports making GET requests based on alternate IDs, so that the AssignmentPro ID can quickly be returned and used for other requests; the API will still expect the AssignmentPro ID for relevant relationships or additional POST or PATCH requests.
If any of the above fields storing alternate identifiers are encrypted, the Security Role tied to the API Subscriber must have decrypt rights granted, or else the API will return an error.