查询用户属性
查询用户属性
支持开发者查询指定用户ID或匿名用户ID,批量查询用户属性值,每次查询最多支持100个用户ID或匿名用户ID。
请求方式
GET
调用地址
https://api-${endpoint}/v2/user-property/query
调用验证
详情参见 API 概述的鉴权方式说明。
请求
请求示例
curl -X GET 'https://api-${endpoint}/v2/user-property/query' \
-H 'Authorization: Bearer ${token}' \
-d '{
"user_ids": [
"example_user_id_1",
"example_user_id_2"
],
"anonymous_ids": [
"example_anonymous_id_1",
"example_anonymous_id_2"
]
}'
curl -X GET 'https://api-${endpoint}/v2/user-property/query' \
-H 'Authorization: Bearer ${token}' \
-d '{
"user_ids": [
"example_user_id_1",
"example_user_id_2"
],
"anonymous_ids": [
"example_anonymous_id_1",
"example_anonymous_id_2"
]
}'
此代碼塊在浮窗中顯示
请求头
字段 | 类型 | 说明 |
---|---|---|
Authorization | Bearer ${token} | 使用 Authorization: Bearer ${token}进行调用验证,请在 API 密钥页面获取密钥作为 token。 |
请求体
参数 | 类型 | 说明 | required |
---|---|---|---|
user_ids | string | 需要查询用户属性的用户id | 必填,与anonymous_ids二选一 |
anonymouse_ids | string | 需要查询用户属性的匿名用户id | 必填,与user_ids二选一 |
user_id 与 anonymouse_id 必须二选一,若均传入,则以 user_id 为准。
响应
响应体
{
{
"user_id": "example_user_id_1",
"property_values": [
{
"property_name": "example_property_name",
"value": "example_value"
},
{
"property_name": "example_property_name",
"value": "example_value"
}
]
},
{
"anonymous_id": "example_anonymous_id_2",
"property_values": [
{
"property_name": "example_property_name",
"value": "example_value"
},
{
"property_name": "example_property_name",
"value": "example_value"
}
]
}
}
{
{
"user_id": "example_user_id_1",
"property_values": [
{
"property_name": "example_property_name",
"value": "example_value"
},
{
"property_name": "example_property_name",
"value": "example_value"
}
]
},
{
"anonymous_id": "example_anonymous_id_2",
"property_values": [
{
"property_name": "example_property_name",
"value": "example_value"
},
{
"property_name": "example_property_name",
"value": "example_value"
}
]
}
}
此代碼塊在浮窗中顯示
成功响应
参数 | 类型 | 说明 |
---|---|---|
user_id | string | 所查询的user_id |
anonymous_id | string | 所查询的anonymous_id |
property_values | list | user_id的用户属性和属性值列表 |
property_name | string | 用户属性名称 |
value | object | 用户属性值 |
失败响应
参数 | 类型 | 说明 |
---|---|---|
code | int | 错误码 |
message | string | 错误信息 |
状态码
状态码 | 说明 |
---|---|
200 | 成功 |
400 | 参数错误 |
401 | 未授权 |
403 | 权限不足 |
500 | 服务器错误 |
503 | user_id不存在 |
504 | 匿名用户ID不存在 |