- Print
- DarkLight
- PDF
List Channel Members By Highest Role
- Print
- DarkLight
- PDF
Lists all channel users sorted by their room scoped roles.
Room members are sorted by their most important role in the room. The following hierarchy is used: Owner > Moderator > Other roles. The information related to each user's highest role is returned in the highestRole object within each of them.
The highestRole object contains a numeric level field which ranges from 0 to 2. Level 0 stands for room owners, while level 1 is assigned to moderators (that are not room owners) and level 2 is assigned to all other team members regardless of their room scoped roles.
The highestRole object also contains a role field, which has three possile values: owner, moderator or member, which are assigned to levels 0, 1 and 2, respectively. The list of elements a user can use to sort the list is limited. The current sortable element is:username
Changelog
| Version | Description |
|---|---|
| 6.5.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
The user's status (search filter).
The room id. It is required if the roomName is not provided.
The room name. It is required if the roomId is not provided.
Extra search filters to be applied to the fields defined in the Accounts_SearchFields setting.
The number of items to return.
List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items.
OK
{
"members": [
{
"_id": "JmR3T4TFfppJCfmq9",
"status": "offline",
"_updatedAt": "2023-07-20T20:43:05.895Z",
"name": "Matheus Barbosa Silva",
"statusConnection": "offline",
"username": "matheus.barbosa",
"avatarETag": "fdJn5SqCwg4ZwbywD",
"highestRole": {
"role": "owner",
"level": 0
}
},
{
"_id": "edjvbnb7pGC3MZNSP",
"status": "offline",
"_updatedAt": "2023-07-17T21:42:31.845Z",
"username": "john",
"name": "John",
"statusConnection": "offline",
"highestRole": {
"role": "member",
"level": 2
}
}
],
"count": 2,
"offset": 0,
"total": 35,
"success": true
}