The GetUsers method matches the GetUserData method in data returned except that it returns data for multiple users matching filtering parameters.
class Test { static void Main() { var client = new UserManagementServiceClient(); var getUsersResponse = client.GetUsers(authToken, null, 1, 2, null, true, null, null); if (!getUsersResponse.CallSuccess) { Console.WriteLine(getUsersResponse.FailureMessage); return; } var userList = getUsersResponse.ResultData.ResultPage; foreach (var user in userList) { Console.WriteLine("UserName: {0} | Email: {1} | First Name: {2}", user.UniqueIdentifier, user.Email, user.Profile.NameValueList[0].Value); if (user.RoleMemberships != null) { Console.WriteLine("User has the following roles :"); foreach (var role in user.RoleMemberships) { Console.WriteLine(role); } } } //Always close the client client.Close(); } }
Input Parameters
Parameter | Type | Description |
---|---|---|
authToken | string | Authentication token to validate permission over the data requested |
provider | string | This should be a null or empty string |
pageNumber | int | Page number to pull for users supplying 0 will pull all pages at once |
pageSize | int | Number of results to pull into a single page of users |
sortField | string | Field to sort the data returned on. Valid values are : UniqueIdentifier, Email |
sortAscending | bool | True will sort the data ascending, false will sort the data descending |
filterField | string | Field to filter user data on. Valid values are : UniqueIdentifier, Email, UserName, GUID, Created, CreatedBy, ModifiedDate, ModifiedBy |
filterValue | string | Value to filter the FilterField on |
There is currently an issue in 2016 Q4 which causes this method to not sort properly by “Email”