TIMGroupGetMemberInfoList

Introduction

Get member info list

Call TIMGroupGetMemberInfoList to get the profile of group members in batches. You can pass in multiple group_get_members_info_list_param_identifier_array at a time to improve network transmission efficiency.

Common group (Work, Meeting, Group, Community) restrictions:

group_member_get_info_option_role_flag can only be enums in TIMGroupMemberRoleFlag and SDK will return specified roles.

AVChatRoom restrictions:

If set group_member_get_info_option_role_flag as enums in TIMGroupMemberRoleFlag and SDK will return all the members. This rule is retriving the latest joined members (Maximum 1000, Ultimate edition only).

If set group_member_get_info_option_role_flag as custom mark, it will retrieve the custom role list (Ultimate edition only).

Group member info only contains userID | nickName | faceURL | role.

Parameter details

Parameter name Parameter type Required Description
getGroupMemberInfoParams GetGroupMemberInfoParams yes Param of getting member info list

Returned template

Promise<commonResult<GetMemberInfoResult>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: GetMemberInfoResult | undefined;
    json_params?: GetMemberInfoResult | undefined; 
    user_data?: string | undefined;
}

Return value details

name type description
code TIMResultTIMErrCode Request result: Error codes. 0 means success.
desc string | undefined The description of the error. It will be empty if success.
json_param GetMemberInfoResult | undefined Return value of calling API
json_params GetMemberInfoResult | undefined Return value of calling API. Compatible field, which is returned in some cases.
user_data string | undefined ImSDK is responsible for transporting user-defined data without any processing

Code example

import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { GetGroupMemberInfoParams } from "im_electron_sdk/dist/interfaces";

let groupId = ''

let param: GetGroupMemberInfoParams = {
    params: {
        group_get_members_info_list_param_group_id: groupId,// required
        group_get_members_info_list_param_next_seq: 0,// optional
        group_get_members_info_list_param_identifier_array: [''],// optional
        group_get_members_info_list_param_option: {
            group_member_get_info_option_info_flag: 0,// optional
            group_member_get_info_option_role_flag: 0,// optional
            group_member_get_info_option_custom_array: ['']// optional
        }
    },
    data: ''// optional
}
const { code } = await timRenderInstance.TIMGroupGetMemberInfoList(param)
if (code == 0) {
    // success
}

results matching ""

    No results matching ""