TIMGroupGetGroupAttributes

Introduction

Get group attributes

Only works with AVChatRoom temporarily.

If json_keys is NULL, you will get all group attributes.

Group attributes support all group types except topics

initGroupAttributes、setGroupAttributes、deleteGroupAttributes 接口合并计算, SDK 限制为5秒10次,超过后回调8511错误码;后台限制1秒5次,超过后返回10049错误码

Parameter details

Parameter name Parameter type Required Description
params DeleteAttributeParams yes Param of getting group attributes

Returned template

Promise<commonResult<Array<GroupAttributes>>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: Array<GroupAttributes> | undefined;
    json_params?: Array<GroupAttributes> | 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 Array< GroupAttributes > | undefined Return value of calling API
json_params Array< GroupAttributes > | 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 { DeleteAttributeParams } from "im_electron_sdk/dist/interfaces";

let grouId = ''
let attributesKey = ''
let param: DeleteAttributeParams = {
    groupId: grouId, // required
    attributesKey: [attributesKey], // required
    data: ''// optional
}
const { code } = await timRenderInstance.TIMGroupGetGroupAttributes(param)
if (code == 0) {
    // success
}

results matching ""

    No results matching ""