目录
此内容是否有帮助?

# 用户属性分析 API

调用方法请参见Open API文档中的调用方法描述。

可阅读使用手册中 属性分析 了解使用场景。

# 用户属性分析查询

接口URL

/open/user-prop-analyze?token=xxx

请求方式

POST

Content-Type

application/json

请求Query参数

参数名
示例值
参数类型
是否必填
参数描述
token
xxx
String

token

# 请求Body参数

{
  "eventView": {
    "userCrowds": [
      {
        "crowdName": "女",
        "filts": [
          {
            "columnDesc": "性别",
            "columnName": "gender",
            "comparator": "equal",
            "filterType": "SIMPLE",
            "ftv": [
              "女"],
            "specifiedClusterDate": "2022-01-27",
            "tableType": "user",
            "timeUnit": ""
          }],
        "relation": "and"
      },
      {
        "crowdName": "男",
        "filts": [
          {
            "columnDesc": "性别",
            "columnName": "gender",
            "comparator": "equal",
            "filterType": "SIMPLE",
            "ftv": [
              "男"],
            "specifiedClusterDate": "2022-01-27",
            "tableType": "user",
            "timeUnit": ""
          }],
        "relation": "and"
      },
      {
        "crowdName": "性别未知",
        "filts": [
          {
            "columnDesc": "性别",
            "columnName": "gender",
            "comparator": "equal",
            "filterType": "SIMPLE",
            "ftv": [
              "未知"],
            "specifiedClusterDate": "2022-01-27",
            "tableType": "user",
            "timeUnit": ""
          }],
        "relation": "and"
      }]
  },
  "events": [
    {
      "analysis": "SUM",
      "analysisDesc": "总和",
      "eventNameDisplay": "余额总和",
      "filts": [
        {
          "columnDesc": "余额",
          "columnName": "accountbalance",
          "comparator": "greater",
          "filterType": "SIMPLE",
          "ftv": [
            "1"],
          "specifiedClusterDate": "2022-01-27",
          "tableType": "user",
          "timeUnit": ""
        }],
      "quota": "accountbalance",
      "relation": "and",
      "tableType": "user"
    }],
  "projectId": 377,
  "limit": 10,
  "timeoutSeconds": 10,
  "useCache": true
}

# 请求参数说明

参数名
示例值
参数类型
是否必填
参数描述
eventView
-
Object

分组属性
userCrowds -
Object

人群
crowdName
String

人群名称
filts -
List

筛选对象
columnDesc 性别
String

字段显示名
columnName gender
String

字段名称
comparator equal
String

参考: 模型查询API的筛选表达式
filterType SIMPLE
String

过滤模式,SIMPLE:简单,COMPOUND:复合
ftv ["女"]
List

属性对比值
specifiedClusterDate 2022-01-27
String

集群指定日期
tableType user
String

表类型,event:事件表,user:用户表
timeUnit String

过滤时间单位
relation and
String

逻辑关系,and:逻辑与,or:逻辑或
events
-
List

事件指标列表
analysis SUM
String

分析角度
analysisDesc 总和
String

分析角度描述(显示名)
eventNameDisplay 余额总和
String

事件显示名
filts -
List

条件列表列表
columnDesc 余额
String

字段显示名
columnName accountbalance
String

字段名称
comparator greater
String

参考: 模型查询API的筛选表达式
filterType SIMPLE
String

过滤模式,SIMPLE:简单,COMPOUND:复合
ftv ["1"]
List

属性对比值
specifiedClusterDate 2022-01-27
String

集群指定日期
tableType user
String

表类型,event:事件表,user:用户表
timeUnit String

过滤时间单位
quota accountbalance
String

逻辑关系,and:逻辑与,or:逻辑或
relation and
String

逻辑关系,and:逻辑与,or:逻辑或
tableType user
String

表类型,event:事件表,user:用户表
projectId
377
Integer

项目ID
limit
10
Integer

每分析对象的分组数上限,可选参数,默认为1000,最大为10000
timeoutSeconds
10
Integer

请求超时参数,超时则取消查询任务
useCache
true
Boolean

使用缓存,可选参数,默认为true

# 成功响应示例

{
  "data": {
    "data_list": [
      {
        "group_cols": [
          "女"
        ],
        "values": 1140523491
      },
      {
        "group_cols": [
          "男"
        ],
        "values": 1141720850
      },
      {
        "group_cols": [
          "性别未知"
        ],
        "values": 227565607
      }
    ],
    "group_cols_sorted": [
      [
        "女",
        "男",
        "性别未知"
      ]
    ],
    "group_num": 0,
    "result_generate_time": "2022-01-27 15:01:51",
    "unit": ""
  },
  "return_code": 0,
  "return_message": "success"
}

# 响应参数说明

参数名
示例值
参数类型
参数描述
return_code
0
Integer
返回码
return_message
success
String
返回信息
data
-
Object
返回结果
data_list -
List
数据列表
group_cols ["女"]
List
分组或人群列表
values 1140523491
Integer
用户数量
group_cols_sorted ["女"]
List
分组或人群顺序列表
group_num 0
Integer
分组数量
result_generate_time 2022-01-27 15:01:51
String
结果生成时间
unit String
数值属性单位

错误响应示例

{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
参数名
示例值
参数类型
参数描述
return_code
-1008
Integer
返回码
return_message
参数(token)为空
String
返回信息

# 用户属性分析用户列表

接口URL

/open/user-prop-user-list?token=xxx

请求方式

POST

Content-Type

application/json

请求Query参数

参数名
示例值
参数类型
是否必填
参数描述
token
xxx
String

token
projectId
0
Integer

项目ID

# 请求Body参数

{
  "projectId": 0,
  "events": [{
    "analysis": "AVG",
    "filts": [
      {
        "columnName": "latest_login_time",
        "comparator": "relativeCurrentBetween",
        "ftv": [
          "7",
          "1"
        ],
        "tableType": "user"
      }
    ],
    "quota": "diamond_num",
    "relation": "and",
    "tableType": "user"
  }],
  "eventView": {
    "groupBy": [
      {
        "columnName": "user_level",
        "tableType": "user"
      },
      {
        "columnName": "channel",
        "tableType": "user"
      }
    ]
  },
  "sliceGroupVal": [
    "31",
    "app store"
  ],
  "timeoutSeconds": 10
}

# 请求参数说明

参数名
示例值
参数类型
是否必填
参数描述
projectId
0
Integer

项目ID
events
-
List

分析指标
analysis AVG
List

分析类型,聚合操作
filts -
List

筛选项列表
columnName latest_login_time
String

字段名称
comparator relativeCurrentBetween
String

参考: 模型查询API的筛选表达式
ftv ["7", "1"]
List
属性对比值
tableType user
String

表类型,event:事件表,user:用户表
quota diamond_num
String

指标属性(配合analysis,意思是哪个属性的哪个分析角度)
relation and
String

逻辑关系,and:逻辑与,or:逻辑或
tableType user
String

表类型,event:事件表,user:用户表
eventView
-
Object

分组属性表
groupBy -
List

分组属性,可以有零个或者多个
columnName user_level
String

字段名称
tableType user
String

表类型,event:事件表,user:用户表
sliceGroupVal
["31","app store"]
List

所在分组
timeoutSeconds
10
Integer

请求超时参数,超时则取消查询任务

# 成功响应示例

{
  "data": {
    "datalist": [
      {
        "#account_id": "b6909071",
        "#distinct_id": "b12831131",
        "user_level": 31,
        "register_time": "2019-09-23 09:33:31",
        "diamond_num": 1250,
        "first_recharge_time": "2019-11-18 08:50:33",
        "latest_login_time": "2019-11-26 18:15:51",
        "channel": "app store",
        "#user_id": 2961031
      },
      {
        "#account_id": "a6013000",
        "#distinct_id": "a11167000",
        "user_level": 31,
        "register_time": "2019-09-02 19:15:08",
        "diamond_num": 72,
        "first_recharge_time": "2019-09-02 19:18:36",
        "latest_login_time": "2019-11-24 10:02:38",
        "channel": "app store",
        "#user_id": 2577000
      },
      {
        "#account_id": "j2614535",
        "#distinct_id": "j4855535",
        "user_level": 31,
        "register_time": "2019-08-24 20:40:19",
        "diamond_num": 820,
        "latest_login_time": "2019-11-21 14:16:42",
        "channel": "app store",
        "#user_id": 1120535
      }
    ],
    "columMeta": {
      "#account_id": "账户ID",
      "#distinct_id": "访客ID",
      "user_level": "用户等级",
      "register_time": "注册时间",
      "diamond_num": "当前拥有钻石数",
      "first_recharge_time": "首次充值时间",
      "latest_login_time": "最后登录时间",
      "channel": "渠道"
    }
  },
  "return_code": 0,
  "return_message": "success"
}

# 响应参数说明

参数名
示例值
参数类型
参数描述
return_code
0
Integer
返回码
return_message
success
String
返回信息
data
-
Object
返回结果
datalist -
List
用户信息
columMeta -
Map
字段含义映射

错误响应示例

{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
参数名
示例值
参数类型
参数描述
return_code
-1008
Integer
返回码
return_message
参数(token)为空
String
返回信息

# 用户事件列表查询

接口URL

/open/user-event-list?token=xxx

请求方式

POST

Content-Type

application/json

请求Query参数

参数名
示例值
参数类型
是否必填
参数描述
token
xxx
String

token

# 请求Body参数

{
  "eventNames": [
    "payment",
    "level_up",
    "activity_attend",
    "draw_card",
    "register",
    "logout",
    "login",
    "gold_get",
    "gold_consume"
  ],
  "pagerHeader": {
    "pageNum": 1,
    "pageSize": 2
  },
  "projectId": 377,
  "startDateTime": ["2021-11-04 00:00:00"],
  "dateFormat": "week",
  "firstDayOfWeek": 1,
  "userId": 795687603434164226,
  "timeoutSeconds": 10,
  "useCache": true
}

# 请求参数说明

参数名
示例值
参数类型
是否必填
参数描述
eventNames
["payment"]
List

包含的事件列表
pagerHeader
-
Object

通用分页请求头
pageNum 1
Long

起始页
pageSize 2
Long

每页个数
projectId
377
Integer

项目ID
startDateTime
["2021-11-04 00:00:00"]
List

开始时间列表 yyyy-MM-dd HH:mm:ss
dateFormat
week
String

时间维度单位
minute:按1分钟
minute5:按5分钟(v3.5开始支持)
minute10:按10分钟(v3.5开始支持)
hour:按小时
day:按天
week:按周
month:按月
total:总计
firstDayOfWeek
1
Integer

周首日
userId
795687603434164226
Long

分析目标的用户ID
timeoutSeconds
10
Integer

请求超时参数,超时则取消查询任务
useCache
true
Boolean

使用缓存,可选参数,默认为true

# 成功响应示例

{
  "data": {
    "columnDescMeta": {
      "network": "网络类型",
      "ip": "IP",
      "browser": "浏览器",
      "browser_version": "浏览器版本",
      "manufacturer": "制造商",
      "#lib": "SDK类型",
      "channel": "来源渠道",
      "platform": "平台",
      "serverid": "区服ID",
      "device_type": "设备类型",
      "#lib_version": "SDK版本",
      "os_version": "操作系统版本",
      "app_version": "app版本",
      "os": "操作系统",
      "lib": "运行库",
      "level": "用户等级",
      "model": "机型",
      "screen_height": "屏幕高度",
      "carrier_name": "运营商",
      "vip_level": "VIP等级",
      "brand": "品牌",
      "currency_type": "币种",
      "pay_amount": "付费金额",
      "diamond_get_amount": "钻石获取量",
      "payment_name": "购买礼包名",
      "is_first_pay": "是否首次付费",
      "#country_code": "国家地区代码",
      "#ip": "客户端IP",
      "#city": "城市",
      "#province": "省份",
      "#country": "国家地区",
      "screen_width": "屏幕宽度",
      "device_id": "设备ID",
      "#zone_offset": "时区偏移"
    },
    "eventNameDescMeta": {
      "anyEvent": "任意事件",
      "activity_attend": "参加活动",
      "draw_card": "抽卡事件",
      "gold_consume": "金币获取",
      "gold_get": "获取金币",
      "level_up": "升级事件",
      "login": "登录",
      "logout": "用户登出",
      "payment": "付费事件",
      "register": "注册"
    },
    "resultGenerateTime": "2022-01-27 15:46:08",
    "userEventSeqList": [
      {
        "event_name": "login",
        "properties": {
          "#event_time": "2021-11-04 15:59:39.179",
          "network": "WIFI",
          "ip": "27.17.30.245",
          "browser": "Safari",
          "browser_version": "Safari 11.0.3",
          "manufacturer": "苹果",
          "#lib": "easydata",
          "channel": "百度",
          "platform": "WeGame平台",
          "serverid": "10",
          "device_type": "desktop",
          "#lib_version": "1.0",
          "os_version": "iOS 11.4",
          "app_version": "V1.0",
          "os": "iOS",
          "lib": "JS",
          "level": "93",
          "model": "iPhone X",
          "screen_height": "681",
          "carrier_name": "中国联通",
          "vip_level": "1",
          "brand": "苹果",
          "#country_code": "",
          "#ip": "localhost",
          "#city": "未知",
          "#province": "未知",
          "#country": "未知",
          "screen_width": "360",
          "device_id": "47BjM",
          "#zone_offset": "-5"
        },
        "time": "2021-11-04 15:59:39.179"
      },
      {
        "event_name": "payment",
        "properties": {
          "#event_time": "2021-11-04 15:59:46.179",
          "network": "WIFI",
          "ip": "27.17.30.245",
          "browser": "Safari",
          "browser_version": "Safari 11.0.3",
          "manufacturer": "苹果",
          "#lib": "easydata",
          "channel": "百度",
          "platform": "WeGame平台",
          "serverid": "10",
          "device_type": "desktop",
          "#lib_version": "1.0",
          "os_version": "iOS 11.4",
          "app_version": "V1.0",
          "os": "iOS",
          "lib": "JS",
          "level": "93",
          "model": "iPhone X",
          "screen_height": "681",
          "carrier_name": "中国联通",
          "vip_level": "1",
          "brand": "苹果",
          "currency_type": "点券",
          "pay_amount": "536",
          "diamond_get_amount": "7485",
          "payment_name": "地尊礼包",
          "is_first_pay": false,
          "#country_code": "",
          "#ip": "localhost",
          "#city": "未知",
          "#province": "未知",
          "#country": "未知",
          "screen_width": "360",
          "device_id": "47BjM",
          "#zone_offset": "-5"
        },
        "time": "2021-11-04 15:59:46.179"
      }
    ]
  },
  "return_code": 0,
  "return_message": "success"
}

# 响应参数说明

参数名
示例值
参数类型
参数描述
return_code
0
Integer
返回码
return_message
success
String
返回信息
data
-
Object
返回结果
columnDescMeta -
Map
属性名映射
eventNameDescMeta -
Map
事件名
resultGenerateTime 2022-01-27 15:46:08
String
结果生成时间
userEventSeqList -
List
用户序列列表
event_name login
String
事件名
properties -
Map
事件属性详情
time 2021-11-04 15:59:46.179
String
时间

错误响应示例

{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
参数名
示例值
参数类型
参数描述
return_code
-1008
Integer
返回码
return_message
参数(token)为空
String
返回信息