This endpoint returns user records based on specified search criteria.
GET
Request
Url Params
tenantId | int | the Id of the tenant which contains the users to search |
searchAccountType | int | Can be one of the following: 0 - search for open accounts only 1 - search for closed accounts only 2 - search all accounts |
searchType | string | Can be one of the following: 'ua' - search by user account Id (also know as system Id) 'pr' - search by payroll number 'ni' - search by NI number |
searchText | string | the criteria to search for |
Authorization
The following authorization header is required. The authorisation header should be set to a 'Bearer Token' type
Token |
Response
The response will return an array of 0 to n JSON objects. Each JSON object in the array contains the following properties:
id | int | the employee Id of the user |
emailAddress | string | the email address of the user |
userAccountId | int | the user account Id of the user |
torusAccountId | int | the torus account Id of the user |
displayName | string | the display name of the user |
linkAddress | string | the path to select the user in the MyWorkPal admin portal |
extraRegistrationDetailsComplete | bool | indicates if the user has completed extra registration. Only valid if the tenant has extra registration enabled |
extraRegistrationDetailsCompleteDate | dateTime | the date extra registration was completed |
torusNonValidated | bool | indicates if the user account has been validated |
outOfOffice | bool | indicates if the user account has been set to 'Out Of Office' |
Permissions
The API Client requires at least readonly permissions to Tenants to successfully retrieve results (See Admin User Roles for more details). Only tenants/users that the API client has access to will be returned.
Examples
C# Example
var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://{platform API url}/api/admin/tenant/{tenantId}/search/{searchAccountType}/{searchType}/{searchText} "); request.Headers.Add("Authorization", "Bearer {access token}"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync());
cURL Example
curl --location 'https://{platform API url}/api/admin/tenant/{tenantId}/search/{searchAccountType}/{searchType}/{searchText}' \ --header 'Authorization: Bearer {access token}'