menu
Is this helpful?

# 属性分析模型 API

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

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

# 用户属性分析查询

接口URL

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

请求方式

POST

Content-Type

application/json

请求Query参数

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

# 请求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 分组属性
eventView.userCrowds - Object 人群
eventView.userCrowds.crowdName String 人群名称
eventView.userCrowds.filts - List 筛选对象
eventView.userCrowds.filts.columnDesc 性别 String 字段显示名
eventView.userCrowds.filts.columnName gender String 字段名称
eventView.userCrowds.filts.comparator equal String 参考: 模型查询API的筛选表达式
eventView.userCrowds.filts.filterType SIMPLE String 过滤模式,SIMPLE:简单,COMPOUND:复合
eventView.userCrowds.filts.ftv ["女"] List 用于属性比较边界的字面常量
eventView.userCrowds.filts.specifiedClusterDate 2022-01-27 String 指定对应日期的标签历史版本
eventView.userCrowds.filts.tableType user String 表类型枚举值
eventView.userCrowds.filts.timeUnit String 过滤时间单位
eventView.userCrowds.relation and String 逻辑关系,and:逻辑与,or:逻辑或
events - List 事件指标列表
events.analysis SUM String 分析角度
events.analysisDesc 总和 String 分析角度描述(显示名)
events.eventNameDisplay 余额总和 String 事件显示名
events.filts - List 条件列表列表
events.filts.columnDesc 余额 String 字段显示名
events.filts.columnName accountbalance String 字段名称
events.filts.comparator greater String 参考: 模型查询API的筛选表达式
events.filts.filterType SIMPLE String 过滤模式,SIMPLE:简单,COMPOUND:复合
events.filts.ftv ["1"] List 用于属性比较边界的字面常量
events.filts.specifiedClusterDate 2022-01-27 String 指定对应日期的标签历史版本
events.filts.tableType user String 表类型枚举值
events.filts.timeUnit String 过滤时间单位
events.quota accountbalance String 逻辑关系,and:逻辑与,or:逻辑或
events.relation and String 逻辑关系,and:逻辑与,or:逻辑或
events.tableType user String 表类型枚举值
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.data_list - List 数据列表
data.data_list.group_cols ["女"] List 分组或人群列表
data.data_list.values 1140523491 Integer 用户数量
data.group_cols_sorted ["女"] List 全部分组或人群顺序列表
data.group_num 0 Integer 分组数量
data.result_generate_time 2022-01-27 15:01:51 String 结果生成时间
data.unit String 数值属性单位

错误响应示例

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

# 用户属性分析全量下载

接口URL

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

请求方式

POST

Content-Type

application/json

请求Query参数

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

# 请求Body参数

{
        "eventView": {
                "groupBy": [{
                        "columnDesc": "渠道",
                        "columnName": "channel",
                        "propertyRange": "",
                        "specifiedClusterDate": "2022-03-10",
                        "tableType": "user"
                }],
                "userCrowds": []
        },
        "events": [{
                "analysis": "TRIG_USER_NUM",
                "analysisDesc": "用户数",
                "eventNameDisplay": "",
                "filts": [{
                        "columnDesc": "账户ID",
                        "columnName": "#account_id",
                        "comparator": "notNull",
                        "filterType": "SIMPLE",
                        "ftv": [],
                        "specifiedClusterDate": "2022-03-10",
                        "tableType": "user",
                        "timeUnit": ""
                }],
                "quota": "",
                "relation": "and",
                "tableType": "user"
        }],
        "projectId": 390
}

# 请求参数说明

$$参数名 示例值 参数类型 是否必填 参数描述
eventView - Object 参数内容与用户属性分析查询接口一致
events - List 参数内容与用户属性分析查询接口一致
projectId 377 Integer 项目ID

# 响应

同TE系统属性分析全量下载

# 用户属性分析用户列表

接口URL

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

请求方式

POST

Content-Type

application/json

请求Query参数

参数名 示例值 参数类型 是否必填 参数描述
token xxx String 查询密钥
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 参数内容与用户属性分析查询接口一致
eventView - Object 参数内容与用户属性分析查询接口一致
sliceGroupVal ["31","app store"] List 哪个分组进行下钻
eventIndex 0 Integer 人群对比人群索引,从0开始
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 返回结果
data.datalist - List 用户信息
data.columMeta - Map 字段含义映射

错误响应示例

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

# 属性分析用户列表下载

接口URL

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

请求方式

POST

Content-Type

application/json

请求Query参数

参数名 示例值 参数类型 是否必填 参数描述
token xxx String 查询密钥
projectId 0 Integer 项目ID

# 请求Body参数

{
        "eventView": {
                "endTime": "2022-03-08 16:14:02",
                "groupBy": [],
                "recentDay": "",
                "startTime": "2022-03-08 16:14:02",
                "userCrowds": [{
                        "crowdName": "人群1",
                        "filts": [],
                        "relation": "and"
                }, {
                        "crowdName": "人群2",
                        "filts": [],
                        "relation": "and"
                }]
        },
        "events": [{
                "analysis": "TRIG_USER_NUM",
                "analysisDesc": "用户数",
                "eventNameDisplay": "",
                "filts": [{
                        "columnDesc": "账户ID",
                        "columnName": "#account_id",
                        "comparator": "notNull",
                        "filterType": "SIMPLE",
                        "ftv": [],
                        "specifiedClusterDate": "2022-03-08",
                        "tableType": "user",
                        "timeUnit": ""
                }],
                "quota": "",
                "relation": "and",
                "tableType": "user"
        }],
        "projectId": 319,
        "sliceGroupVal": ["人群2"],
        "eventIndex": 0,
        "selectedColumns": ["#account_id", "#distinct_id", "accountid"]
}

# 请求参数说明

$$参数名 示例值 参数类型 是否必填 参数描述
projectId 0 Integer 项目ID
events - List 参数内容与用户属性分析查询接口一致
eventView - Object 参数内容与用户属性分析查询接口一致
sliceGroupVal ["31","app store"] List 哪个分组进行下钻
eventIndex 0 Integer 人群对比人群索引,从0开始
selectedColumns ["#account_id"] array 需要下载的列

# 响应

同TE系统属性分析用户列表下载

# 用户事件列表查询

接口URL

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

请求方式

POST

Content-Type

application/json

请求Query参数

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

# 请求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,
  "zoneOffset": 8
}

# 请求参数说明

$$参数名 示例值 参数类型 是否必填 参数描述
eventNames ["payment"] List 包含的事件列表
pagerHeader - Object 通用分页请求头
pagerHeader.pageNum 1 Long 起始页
pagerHeader.pageSize 2 Long 每页个数
projectId 377 Integer 项目ID
startDateTime ["2021-11-04 00:00:00"] List 开始时间列表 yyyy-MM-dd HH:mm:ss
dateFormat week String 时间维度单位
  • day:按天

  • week:按周

  • month:按月

  • total:总计

firstDayOfWeek 1 Integer 周首日
userId 795687603434164226 Long 分析目标的用户ID
timeoutSeconds 10 Integer 请求超时参数,超时则取消查询任务
useCache true Boolean 使用缓存,可选参数,默认为true
zoneOffset 10 Integer 时区

# 成功响应示例

{
  "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 返回结果
data.columnDescMeta - Map 属性名映射
data.eventNameDescMeta - Map 事件名
data.resultGenerateTime 2022-01-27 15:46:08 String 结果生成时间
data.userEventSeqList - List 用户序列列表
data.userEventSeqList.event_name login String 事件名
data.userEventSeqList.properties - Map 事件属性详情
data.userEventSeqList.time 2021-11-04 15:59:46.179 String 时间

错误响应示例

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

# 用户属性分析通用枚举

# 用户属性分析聚合类型枚举值

描述 是否需要属性
TRIG_USER_NUM 触发用户数
SUM 数值总和
AVG 数值平均值
MAX 数值最大值
MIN 数值最小值
DISTINCT 去重数
TRUE 为真数
FALSE 为假数
IS_NOT_EMPTY 不为空数
IS_EMPTY 为空数
ARRAY_DISTINCT 列表整体去重数
ARRAY_SET_DISTINCT 元素集合去重数
ARRAY_ITEM_DISTINCT 列表元素去重数
MEDIAN 中位数
PERCENTILE 分位数