Get the member list
Update time: 2022/12/13 17:02:40
You can get a paginated list of participants in a chat room, a list of permanent participants by role, and a list of online participants.
Get a paginated list of participants
Get a paginated list of participants of a specified role in a specified chat room within a certain period of time.
URL
POST https://api.netease.im/nimserver/chatroom/membersByPage.action HTTP/1.1
Content-Type:application/x-www-form-urlencoded;charset=utf-8
Request parameters
-
For information about how to set the header in a POST request, see API Call methods.
-
The settings of the body in a POST request:
Parameter | Type | Required | Description |
---|---|---|---|
roomid | long | Yes | Chat room ID |
type | int | Yes | The type of participants to be queried, 0: permanent participants; 1: non-permanent participants; 2: online permanent participants |
endtime | long | Yes | Unit: milliseconds, the timestamp of the last participant in descending order, 0: the current system time |
limit | long | Yes | The limit of returned entries, the value must be equal to or less than 100 |
Response parameters
Parameter | Type | Description |
---|---|---|
roomid | long | Chat room ID |
accid | String | The accid of a user |
nick | String | The nickname in the chat room |
avator | String | The avatar in the chat room |
ext | String | Extension field |
type | String |
Role type: UNSET(undefined), LIMITED (limited user, in the blocklist or banned list), COMMON (regular participant), CREATOR, MANAGER (administrator), TEMPORARY (temporary participant) |
level | int | Participant level. If no level is specified for participants, no such field exists. |
onlineStat | Boolean | The online status |
enterTime | long | Time when a user joins a chat room |
blacklisted | Boolean | Whether the participant is in the blacklist. If not, no such field exists. |
muted | Boolean | Whether the participant is muted. If not, no such field exists. |
tempMuted | Boolean | Whether the participant is temporarily muted. If not, no such field exists. |
tempMuteTtl | long | Remaining time to unmute a participant in seconds. If the participant is not muted, no such field exists. |
isRobot | Boolean | Whether it is a chatbot. If not, no such field exists. |
robotExpirAt | int | The time when a chatbot expires in seconds. If not a chatbot, no such field) |
Example
cURL request example
curl -X POST -H "CheckSum: 32dc17d0190f37037abc9feb749bbf049c9367e7" -H "AppKey: fe416640c8e8a72734219e1847ad2547" -H "Nonce: 1" -H "CurTime: 1451207708" -H "Content-Type: application/x-www-form-urlencoded" -d 'roomid=4235&type=0&endtime=0&limit=20' "https://api.netease.im/nimserver/chatroom/membersByPage.action"
Example success response
"Content-Type": "application/json; charset=utf-8"
{
"desc": {
"data": [
{
"roomid": 111,
"accid": "abc",
"nick": "abc",
"avator": "http://nim.nos.netease.com/MTAxMTAwMg==/bmltYV8xNzg4NTA1NF8xNDU2Mjg0NDQ3MDcyX2E4NmYzNWI5LWRhYWEtNDRmNC05ZjU1LTJhMDUyMGE5MzQ4ZA==",
"ext": "ext",
"type": "MANAGER",
"level": 2,
"onlineStat": true,
"enterTime": 1487145487971,
"blacklisted": true,
"muted": true,
"tempMuted": true,
"tempMuteTtl": 120,
"isRobot": true,
"robotExpirAt":120
}
]
},
"code": 200
}
Query participants by role
Get a list of permanent participants by role (creator, administrator, participants in the blocklist or muted list).
URL
POST https://api.netease.im/nimserver/chatroom/queryMembersByRole.action HTTP/1.1
Content-Type:application/x-www-form-urlencoded;charset=utf-8
Request parameters
-
For information about how to set the header in a POST request, see API Call methods.
-
The settings of the body in a POST request:
Parameter | Type | Required | Description |
---|---|---|---|
roomid | long | Yes | Chat room ID |
roles | String | Yes |
Set the role for query, example: {"creator": true, "manager": true, "blacklist": false,"mute": false} Fields: 1. creator: the creator of the chat room 2. manager: the administrator 3. blacklist: participant in the blocklist 4. mute: muted participant Note: If you set the value to false or leave the field empty, the corresponding role information will be ignored. |
Response parameters
Parameter | Type | Description |
---|---|---|
roomid | long | Chat room ID |
accid | String | The accid of a user |
nick | String | The nickname in the chat room |
avator | String | The avatar in the chat room |
ext | String | Extension field |
type | String |
Role type: UNSET(undefined), LIMITED (limited user, in the blocklist or banned list), COMMON (regular participant), CREATOR, MANAGER (administrator), TEMPORARY (temporary participant) |
level | int | Participant level. If no level is specified for participants, no such field exists. |
onlineStat | Boolean | The online status |
enterTime | long | Time when a user joins a chat room |
blacklisted | Boolean | Whether the participant is in the blacklist. If not, no such field exists. |
muted | Boolean | Whether the participant is muted. If not, no such field exists. |
tempMuted | Boolean | Whether the participant is temporarily muted. If not, no such field exists. |
tempMuteTtl | long | Remaining time to unmute a participant in seconds. If the participant is not muted, no such field exists. |
isRobot | Boolean | Whether it is a chatbot. If not, no such field exists. |
robotExpirAt | int | The time when a chatbot expires in seconds. If not a chatbot, no such field) |
Example
cURL request example
curl -X POST -H "CheckSum: 51eb13ea5ee3a2c00e8388e48e61c65c7866c366" -H "AppKey: fe416640c8e8a72734219e1847ad2547" -H "Nonce: 1" -H "CurTime: 1451207708" -H "Content-Type: application/x-www-form-urlencoded" -d 'roomid=66&roles=%7B%22creator%22%3A%20true%2C%20%22manager%22%3A%20true%2C%22blacklist%22%3A%20true%2C%22mute%22%3A%20true%7D' 'https://api.netease.im/nimserver/chatroom/queryMembersByRole.action'
Example success response
"Content-Type": "application/json; charset=utf-8"
{
"code": 200,
"desc":
{
"data":
[
{
"accid": "user01",
"nick": "nick01",
"ext": "",
"level": 0,
"avator": "avator01.png",
"type": "CREATOR", // The creator of the chat room
"roomid": 72,
"onlineStat": true
},
{
"accid": "user02",
"nick": "nick02",
"ext": "",
"level": 0,
"avator": "avator02.png",
"type": "MANAGER", // Administrator
"roomid": 72,
"onlineStat": false
},
{
"accid": "user03",
"nick": "nick03",
"ext": "",
"blacklisted": true, //Participant in the blocklist
"level": 0,
"avator": null,
"type": "LIMITED",
"roomid": 72,
"onlineStat": false
},
{
"accid": "user04",
"nick": "nick04",
"ext": "",
"level": 0,
"avator": null,
"type": "LIMITED",
"muted": true, //Muted participant
"roomid": 72,
"onlineStat": false
}
]
}
}
Get a list of online participants
Get a list of online participants in a chat room.
URL
POST https://api.netease.im/nimserver/chatroom/queryMembers.action HTTP/1.1
Content-Type:application/x-www-form-urlencoded;charset=utf-8
Request parameters
-
For information about how to set the header in a POST request, see API Call methods.
-
The settings of the body in a POST request:
Parameter | Type | Required | Description |
---|---|---|---|
roomid | long | Yes | Chat room ID |
accids | JSONArray | Yes | \["abc", "def"\], list of accounts, up to 200 entries |
Example
cURL request example
curl -X POST -H "CheckSum: 32dc17d0190f37037abc9feb749bbf049c9367e7" -H "AppKey: fe416640c8e8a72734219e1847ad2547" -H "Nonce: 1" -H "CurTime: 1451207708" -H "Content-Type: application/x-www-form-urlencoded" -d 'roomid=4235&accids=["abc", "def"]' "https://api.netease.im/nimserver/chatroom/queryMembers.action"
Example success response
"Content-Type": "application/json; charset=utf-8"
{
"desc": {
"data": [
{
"roomid": 111,
"accid": "abc",
"nick": "cba",
"type": "CREATOR", //COMMON: regular participant; CREATOR: the creator; MANAGER: administrator; TEMPORARY: temporary participant; ANONYMOUS: anonymous participant (unregistered account); LIMITED: limited participant in the blocklist or muted list
"onlineStat": true
}
]
},
"code": 200
}
Status codes
The status code is returned in the response body. For more information, see Status codes.