你可以调用 BatchUpdateUserTags 接口,指定你所属的 AppId、用户 ID、用户 Tag 对已注册的广播用户进行标签更新。
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
使用 POST 方式发起请求。
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | BatchUpdateUserTags | 接口名称,本接口取值:BatchUpdateUserTags |
| Version | String | 是 | 2020-12-01 | 接口版本,本接口取值:2020-12-01 |
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| AppId | Int | 是 | 000000 | 应用的唯一标志 |
| InboxType | Int | 否 | 0 | 信箱,用做逻辑隔离 默认值为 0 |
| UserTags | Array of UserTag | 是 | / | 更新用户信息 |
| Op | Int | 否 | 0 | 标签更新方式。
0。 |
UserTag
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| UserId | Int | 是 | 10001 | 用户 UserId |
| Tags | Map-key(string)-value(string) | 否 | {"key":"value"} | 用户标签 |
https://rtc.volcengineapi.com?Action=BatchUpdateUserTags&Version=2020-12-01
postscript{
"AppId":666675,
"InboxType":0,
"UserTags":[
{
"UserId":10001,
"Tags":{
"key":"value"
}
}
],
"Op":1
}
json返回结果参看 BaseResponse。
其中 Result 的结构如下:
| 参数名 | 类型 | 描述 |
|---|---|---|
| FailedInfos | Array of FailedInfo | 更新失败的用户信息 |
FailedInfo
| 参数名 | 类型 | 描述 |
|---|---|---|
| UserId | Int | 用户 UserId |
| Code | String | 错误码 |
| Message | String | 错误描述 |
正常返回示例
{
"ResponseMetadata": {
"RequestId": "Your_RequestId",
"Action": "BatchUpdateUserTags",
"Version": "2020-12-01",
"Service": "rtc",
"Region": "cn-north-1"
},
"Result": {
"FailedInfos": []
}
}
json