On this page

List all users

GetUsers() returns a paginated list of all users with their metadata.

Requires App Context

Enable App Context in the Admin Portal to store user data. If using Access Manager, uncheck Disallow Get All User Metadata in the App Context configuration.

Method signature

This method takes the following parameters:

1chat.GetUsers(
2 string filter = "",
3 string sort = "",
4 int limit = 0,
5 PNPageObject page = null
6)

Input

* required
ParameterDescription
filter
Type: string
Default:
empty string
Expression used to filter the results. Returns only these memberships whose properties satisfy the given expression. The filter language is defined here.
sort
Type: string
Default:
empty string
Key-value pair of a property to sort by, and a sort direction. Available options are id, name, and updated. Use asc or desc to specify the sorting direction, or specify null to take the default sorting direction (ascending). For example: {name: "asc"}. By default, the items are sorted by the last updated date.
limit
Type: int
Default:
0
Number of objects to return in response.
page
Type: PNPageObject
Default:
null
Object used for pagination to define which previous or next result page you want to fetch.

Output

TypeDescription
Task<UsersResponseWrapper>
An awaitable Task with an object containing the filtered, sorted, and paginated list of users.

Sample code

Fetch all existing user IDs.

1

Other examples

Pagination

Get the total number of 25 users and then specify that you want to fetch the results from the next page using a string that was previously returned from the PubNub server.

1

Deleted users

Return all users with the deleted status.

1

Last updated on