Appearance
同步访客扩展属性
POST /visitor/data/attributes
按商户配置写入当前访客的长期属性。接口返回经过服务端校验、策略合并和展示标准化后的属性集。
请求参数
| 字段 | 位置 | 类型 | 必填 | 用途 |
|---|---|---|---|---|
visitor_attributes | body | array | 是 | 访客属性数组。 |
attribute_mode | body | string | 否 | 合并模式;默认 merge。 |
visitor_attributes[]
| 字段 | 类型 | 必填 | 用途 |
|---|---|---|---|
key | string | 是 | 小写字母开头的属性机器名,最长 64 位。 |
label | string | 是 | 属性展示名称。 |
type | string | 否 | 属性类型,默认 text。 |
value | string | number | boolean | null | 否 | 属性值,不能是对象或数组。 |
editable | boolean | 否 | 是否可由客服编辑;图片属性会被服务端固定为 false。 |
成功响应
json
{
"code": 0,
"msg": "ok",
"data": {
"attributes": [
{ "key": "<属性名>", "label": "<属性标签>", "type": "text", "value": "<属性值>", "editable": false }
]
}
}data.attributes[] 字段与请求属性项一致,但以服务端最终生效的值为准。