please select
  • UIKit
  • SDK
  • Server APIs
Chat/
SDK/
Web/
Group/
SDK
  • Install Chat SDK
  • Initialize Chat SDK
  • Login and Logout
  • Client APIs
  • Changelog
  • Message
    • Overview
    • Send a Message
    • Receive a Message
    • Historical Message
    • Forward Messages
    • Modify a Message
    • Delete Messages
    • Clear History Message
    • Recall a Message
    • Send an Online Message
    • Message Read Receipt
    • Query Messages
    • Targeted Group Message
    • Do not Notify
    • Key-Value Extensions
    • Translation
  • Conversation
    • Overview
    • Conversation List
    • Get Conversations
    • Unread Count
    • Pin Conversations
    • Delete Conversations
    • Mark
    • Conversation Group
  • Group
    • Overview
    • Group Management
    • Group Profile
    • Group Member Management
    • Group Member Profile
    • Custom Group Attribute
    • Group Counter
  • Community Topic
    • Community Management
  • User Profile and Relationship Chain
    • User Profile
    • User Status
    • Friend Management
    • Friend Group
    • Block List
  • Guideline for Beginners
  • Console Guide
    • Creating and Upgrading an Application
    • Basic Configuration
    • Feature Configuration
    • Account Management
    • Group Management
    • Webhook Configuration
  • Product Introduction
    • Message Management
      • One-to-One Message
      • Message Storage
      • Offline Push
      • Group Message
      • Message Formats
    • Account System
      • Login Authentication
      • Online Status Management
    • Group Related
      • Group System
      • Group Management
    • User Profile and Relationship Chain
      • Profile Management
      • Relationship Chain Management
  • Purchase Guide
    • Billing Overview
    • Pricing
  • Error Codes

Group Member Profile

Getting the Profile of Group Members

Note
1. The maximum number of users in each query is 50. If the length of the array passed in is greater than 50, only the first 50 users will be queried, and the rest will be discarded.
API
chat.getGroupMemberProfile(options);
Parameter
The options parameter is of the Object type. It contains the following attribute values:
Name
Type
Description
groupID
String
Group ID
userIDList
Array
List of IDs of the group members to be queried
memberCustomFieldFilter
Array | undefined
Filtering the custom group member field. This attribute is optional. If it is not specified, all the custom group member fields are queried by default.
Returned value
Promise
Sample
let promise = chat.getGroupMemberProfile({
groupID: 'group1',
// Even if you retrieve the profile of only one group member, the value must be of array type
// for example, userIDList: ['user1'].
userIDList: ['user1', 'user2'],
memberCustomFieldFilter: ['group_member_custom'],
});
promise.then(function(imResponse) {
console.log(imResponse.data.memberList); // Group member list
}).catch(function(imError){
console.warn('getGroupMemberProfile error:', imError);
});

Setting the Name Card of a Group Member

Note
1. As an audio-video group doesn't store group member information, this API is not applicable to the group.
API
chat.setGroupMemberNameCard(options);
Parameter
The options parameter is of the Object type. It contains the following attribute values:
Name
Type
Description
groupID
String
Group ID or topic ID
userID
String | undefined
It is optional. By default, the user's own name card is modified.
nameCard
String
Name card of a group member
Returned value
Promise
Sample
let promise = chat.setGroupMemberNameCard({
groupID: 'group1',
userID: 'user1',
nameCard: 'Name card'
});
promise.then(function(imResponse) {
console.log(imResponse.data.group); // New group profile
console.log(imResponse.data.member); // New group member profile
}).catch(function(imError){
console.warn('setGroupMemberNameCard error:', imError);
});

Setting a Custom Group Member Field

Note
1. Ordinary group members can only set their own custom fields.
API
chat.setGroupMemberCustomField(options);
Parameter
The options parameter is of the Object type. It contains the following attribute values:
Name
Type
Description
groupID
String
Group ID or topic ID
userID
String | undefined
Optional. If it is not specified, the user's own custom group member field is modified.
memberCustomField
Array
Custom group member field. Its array elements are as structured below:
key --- String --- Key of the custom field
value --- String --- Value of the custom field
Returned value
Promise
Sample
let promise = chat.setGroupMemberCustomField({
groupID: 'group1',
memberCustomField: [{key: 'group_member_test', value: 'test'}]
});
promise.then(function(imResponse) {
console.log(imResponse.data.group); // New group profile
console.log(imResponse.data.member); // New group member profile
}).catch(function(imError){
console.warn('setGroupMemberCustomField error:', imError);
});