- Print
- DarkLight
- PDF
Group Members By Highest Role
- Print
- DarkLight
- PDF
Lists the participants of a group/channel 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.
- Level 1 is assigned to moderators (who are not room owners).
- 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 possible values: owner, moderator or member, which are assigned to levels 0, 1, and 2, respectively.
Requires view-broadcast-member-list if the room is a broadcast.
Changelog
| Version | Description |
|---|---|
| 6.5.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items.
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}
The room id. It is required if the roomName is not provided.
The room name. It is required if the roomId is not provided.
The user's status (search filter).
Extra search filters to be applied to the fields defined in the Accounts_SearchFields setting.
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": 2,
"success": true
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}