This endpoint returns user records based on specified search criteria.


GET /api/admin/tenant/{tenantId}/search/{searchAccountType}/   {searchType}/{searchText}


Request


Url Params

tenantId
int
the Id of the tenant which contains the users to search
searchAccountTypeintCan be one of the following:
0 - search for open accounts only
1 - search for closed accounts only
2 - search all accounts
searchTypestringCan 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
searchTextstringthe 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 JSON objects.  Each JSON object in the array contains the following properties:


idintthe employee Id of the user
emailAddressstringthe email address of the user
userAccountIdintthe user account Id of the user
torusAccountIdintthe torus account Id of the user
displayNamestringthe display name of the user
linkAddressstringthe path to select the user in the MyWorkPal admin portal
extraRegistrationDetailsCompleteboolindicates if the user has completed extra registration.  Only valid if the tenant has extra registration enabled
extraRegistrationDetailsCompleteDatedateTimethe date extra registration was completed
torusNonValidatedboolindicates if the user account has been validated
outOfOfficeboolindicates 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}'