getPanelAgentConfigAvatarList(params: GetPanelAgentConfigAvatarListParams)

版本要求:
@tuya-miniapp/cloud-api≥1.0.6

描述

获取支持的头像列表。

参数

参数类型必填说明
是请求体

返回值

类型:Promise<GetPanelAgentConfigAvatarListResult>
GetPanelAgentConfigAvatarListResult(字段含义见类型定义与 minituya 返回参数)

引用对象

typeGetPanelAgentConfigAvatarListResult
Array<{
  /** 头像ID */
  avatarId: string;
  /** 头像链接 */
  url: string;
}>

示例代码

请求示例

import { getPanelAgentConfigAvatarList } from '@tuya-miniapp/cloud-api';

const params = {
  devId: 'your_device_id',
  bizCode: 'optional_biz_code',
};

getPanelAgentConfigAvatarList(params)
  .then(result => {
    console.log('头像列表:', result);
  })
  .catch(error => {
    console.error('获取头像列表失败:', error);
  });

返回示例

[
  {
    "avatarId": "avatar_001",
    "url": "https://example.com/avatar1.png"
  },
  {
    "avatarId": "avatar_002",
    "url": "https://example.com/avatar2.png"
  }
]