# 间隔分析模型 API
调用方法请参见Open API文档中的调用方法描述。
可阅读使用手册中 间隔分析 了解使用场景。
# 间隔分析查询
接口URL
/open/interval-analyze?token=xxx
请求方式
POST
Content-Type
application/json
请求Query参数
参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 |
---|---|---|---|---|
token | xxx | String | 是 | token |
# 请求Body参数
{
"eventView": {
"endTime": "2021-10-05 23:59:59",
"filts": [
{
"columnDesc": "品牌",
"columnName": "brand",
"comparator": "equal",
"filterType": "SIMPLE",
"ftv": [
"苹果",
"华为"
],
"specifiedClusterDate": "2022-01-24",
"tableType": "event",
"timeUnit": ""
}
],
"groupBy": [
{
"columnDesc": "品牌",
"columnName": "brand",
"propertyRange": "",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
}
],
"recentDay": "114-115",
"relation": "and",
"startTime": "2021-10-04 00:00:00",
"taIdMeasureVo": {
"columnDesc": "用户唯一ID",
"columnName": "#user_id",
"tableType": "event"
},
"timeParticleSize": "day",
"windowsGapUnit": "hour",
"windowsGapValue": 1
},
"events": [
{
"eventName": "activity_attend",
"eventNameDisplay": "",
"filts": [
],
"relation": "and",
"relationProp": {
"property": {
"columnDesc": "品牌",
"columnName": "brand",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
}
},
"type": "first"
},
{
"eventName": "payment",
"eventNameDisplay": "",
"filts": [
],
"relation": "and",
"relationProp": {
"property": {
"columnDesc": "品牌",
"columnName": "brand",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
},
"relationOperatorValue": 0,
"relationPropNumberOperator": "r_eq"
},
"type": "second"
}
],
"projectId": 377,
"limit": 10,
"timeoutSeconds": 10,
"useCache": true
}
# 请求参数说明
参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 |
---|---|---|---|---|
eventView | - | Object | 是 | 分组属性 |
∟ endTime | 2021-10-05 23:59:59 | String | 否 | 结束时间(格式:yyyy-MM-dd HH:mm:ss),相对时间为空时有效 |
∟ filts | - | List | 否 | 全局筛选项 |
∟ columnDesc | 品牌 | String | 否 | 字段显示名 |
∟ columnName | brand | String | 是 | 字段名 |
∟ comparator | equal | String | 是 | 参考: 模型查询API的筛选表达式 |
∟ filterType | SIMPLE | String | 否 | 过滤模式,SIMPLE:简单,COMPOUND:复合 |
∟ ftv | ["苹果"] | List | 否 | 属性对比值 |
∟ specifiedClusterDate | 2022-01-24 | String | 否 | 集群指定日期 |
∟ tableType | event | String | 是 | 表类型,event:事件表,user:用户表 |
∟ timeUnit | String | 否 | 属性对比值单位,仅对relativeEvent*有效:day,hour,minute | |
∟ groupBy | - | List | 否 | 分组属性,可以有零个或者多个 |
∟ columnDesc | 品牌 | String | 否 | 字段显示名 |
∟ columnName | brand | String | 是 | 字段名 |
∟ propertyRange | String | 否 | 自定义属性区间 | |
∟ specifiedClusterDate | 2022-01-24 | String | 否 | 集群指定日期 |
∟ tableType | event | String | 是 | 表类型,event:事件表,user:用户表 |
∟ recentDay | 114-115 | String | 否 | 相对时间(此项不可与起始时间和结束时间同时为空) |
∟ relation | and | String | 否 | 逻辑关系,and:逻辑与,or:逻辑或 |
∟ startTime | 2021-10-04 00:00:00 | String | 否 | 起始时间(格式:yyyy-MM-dd HH:mm:ss),相对时间为空时有效 |
∟ taIdMeasureVo | - | Object | 否 | 分析主体配置 |
∟ columnDesc | 用户唯一ID | String | 否 | 字段显示名 |
∟ columnName | #user_id | String | 是 | 字段名 |
∟ tableType | event | String | 是 | 表类型,event:事件表,user:用户表 |
∟ timeParticleSize | day | String | 是 | 分析的时间单位 minute:按1分钟 minute5:按5分钟(v3.5开始支持) minute10:按10分钟(v3.5开始支持) hour:按小时 day:按天 week:按周 month:按月 total:总计 |
∟ firstDayOfWeek | Integer | 否 | 当timeParticleSize为week时,指定周首日,1:星期一,2:星期二, ..,7:星期日,最小1,最大7 | |
∟ windowsGapUnit | hour | String | 否 | 窗口时长单位 |
∟ windowsGapValue | 1 | Integer | 否 | 窗口时长 |
events | - | List | 是 | 事件指标列表 |
∟ eventName | activity_attend | String | 是 | 事件名称,特别的,可以使用 anyEvent 表示任意事件 |
∟ eventNameDisplay | String | 否 | 事件显示名 | |
∟ filts | - | List | 否 | 条件列表列表 |
∟ relation | and | String | 否 | 逻辑关系,and:逻辑与,or:逻辑或 |
∟ relationProp | - | Object | 否 | 关联属性 |
∟ property | - | Object | 否 | 关联属性 |
∟ columnDesc | 品牌 | String | 否 | 字段显示名 |
∟ columnName | brand | String | 否 | 字段名 |
∟ specifiedClusterDate | 2022-01-24 | String | 否 | 集群指定日期 |
∟ tableType | event | String | 否 | 表类型,event:事件表,user:用户表 |
∟ relationOperatorValue | 0 | Integer | 否 | 关系操作值 |
∟ relationPropNumberOperator | r_eq | String | 否 | 关系操作符, r_eq:相等 r_high:高 r_low:低 |
∟ type | first | String | 是 | 事件类型,first:初始事件,second:回访事件 |
projectId | 377 | Integer | 是 | 项目ID |
limit | 10 | Integer | 否 | 每分析对象的分组数上限,可选参数,默认为1000,最大为10000 |
timeoutSeconds | 10 | Integer | 否 | 请求超时参数,超时则取消查询任务 |
useCache | true | Boolean | 否 | 使用缓存,可选参数,默认为true |
# 成功响应示例
{
"data": {
"distributionInterval": [
",300",
"300,600",
"600,900",
"900,1200",
"1200,1500",
"1500,1800",
"1800,2100",
"2100,2400",
"2400,2700",
"2700,3000",
"3000,3300",
"3300,"
],
"groupCols": [
[
"苹果"
],
[
"华为"
]
],
"intervalData": {
"dateEntities": [
{
"dateString": "2021-10-04",
"groupEntities": [
{
"groups": [
"苹果"
],
"intervalAggValue": {
"avgValue": 40,
"eventNum": 6646,
"maxValue": 354,
"midValue": 28,
"minValue": 2,
"quarterValue": 16,
"threeQuarterValue": 49,
"userNum": 838
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 5,
"userNum": 5
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 6641,
"userNum": 838
}
}
]
},
{
"groups": [
"华为"
],
"intervalAggValue": {
"avgValue": 39,
"eventNum": 5439,
"maxValue": 313,
"midValue": 28,
"minValue": 2,
"quarterValue": 15,
"threeQuarterValue": 50,
"userNum": 683
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 2,
"userNum": 2
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 5437,
"userNum": 683
}
}
]
}
],
"intervalAggValue": {
"avgValue": 39,
"eventNum": 12085,
"maxValue": 354,
"midValue": 28,
"minValue": 2,
"quarterValue": 16,
"threeQuarterValue": 49,
"userNum": 1520
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 7,
"userNum": 7
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 12078,
"userNum": 1520
}
}
]
},
{
"dateString": "2021-10-05",
"groupEntities": [
{
"groups": [
"苹果"
],
"intervalAggValue": {
"avgValue": 39,
"eventNum": 5700,
"maxValue": 303,
"midValue": 28,
"minValue": 2,
"quarterValue": 16,
"threeQuarterValue": 49,
"userNum": 710
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 1,
"userNum": 1
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 5699,
"userNum": 710
}
}
]
},
{
"groups": [
"华为"
],
"intervalAggValue": {
"avgValue": 40,
"eventNum": 4779,
"maxValue": 374,
"midValue": 28,
"minValue": 2,
"quarterValue": 15,
"threeQuarterValue": 51,
"userNum": 603
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 3,
"userNum": 3
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 4776,
"userNum": 603
}
}
]
}
],
"intervalAggValue": {
"avgValue": 39,
"eventNum": 10479,
"maxValue": 374,
"midValue": 28,
"minValue": 2,
"quarterValue": 16,
"threeQuarterValue": 50,
"userNum": 1313
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 4,
"userNum": 4
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 10475,
"userNum": 1313
}
}
]
}
],
"groupEntities": [
{
"groups": [
"苹果"
],
"intervalAggValue": {
"avgValue": 39,
"eventNum": 12346,
"maxValue": 354,
"midValue": 28,
"minValue": 2,
"quarterValue": 16,
"threeQuarterValue": 49,
"userNum": 1542
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 6,
"userNum": 6
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 12340,
"userNum": 1542
}
}
]
},
{
"groups": [
"华为"
],
"intervalAggValue": {
"avgValue": 39,
"eventNum": 10218,
"maxValue": 374,
"midValue": 28,
"minValue": 2,
"quarterValue": 15,
"threeQuarterValue": 50,
"userNum": 1282
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 5,
"userNum": 5
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 10213,
"userNum": 1282
}
}
]
}
],
"intervalAggValue": {
"avgValue": 39,
"eventNum": 22564,
"maxValue": 374,
"midValue": 28,
"minValue": 2,
"quarterValue": 16,
"threeQuarterValue": 49,
"userNum": 2817
},
"intervalDistributions": [
{
"distribution": "300,600",
"intervalDistributionValue": {
"eventNum": 11,
"userNum": 11
}
},
{
"distribution": ",300",
"intervalDistributionValue": {
"eventNum": 22553,
"userNum": 2817
}
}
]
},
"intervalType": "def",
"timeArray": [
"2021-10-04",
"2021-10-05"
]
},
"return_code": 0,
"return_message": "success"
}
# 响应参数说明
参数名 | 示例值 | 参数类型 | 参数描述 |
---|---|---|---|
return_code | 0 | Integer | 返回码 |
return_message | success | String | 返回信息 |
data | - | Object | 返回结果 |
∟ distributionInterval | [",300","300,"] | List | 分布间隔 |
∟ groupCols | [["苹果"],["华为"]] | List | 分组 |
∟ intervalData | - | Object | 日期数据 |
∟ dateEntities | - | List | 日期列表 |
∟ dateString | 2021-10-04 | String | 日期 |
∟ groupEntities | - | List | 分组列表 |
∟ groups | ["苹果"] | List | 分组值列表 |
∟ intervalAggValue | - | Object | 聚合值 |
∟ avgValue | 39 | Long | 平均值 |
∟ eventNum | 22564 | Long | 事件数 |
∟ maxValue | 374 | Long | 最大值 |
∟ midValue | 28 | Long | 中位数 |
∟ minValue | 2 | Long | 最小值 |
∟ quarterValue | 16 | Long | 上四分位 |
∟ threeQuarterValue | 49 | Long | 下四分位 |
∟ userNum | 2817 | Long | 用户数 |
∟ intervalDistributions | - | List | 分布区间列表 |
∟ distribution | 300,600 | String | 分布区间 |
∟ intervalDistributionValue | - | Object | 分布区间值 |
∟ eventNum | 11 | Long | 事件数 |
∟ userNum | 11 | Long | 用户数 |
∟ intervalType | def | String | 类型 discrete:离散数字 def:默认区间 user_defined:用户自定义 |
∟ timeArray | ["2021-10-04"] | List | 事件列表 |
错误响应示例
{
"return_code": -1008,
"return_message": "参数(token)为空"
}
参数名 | 示例值 | 参数类型 | 参数描述 |
---|---|---|---|
return_code | -1008 | Integer | 返回码 |
return_message | 参数(token)为空 | String | 返回信息 |
# 间隔分析用户列表
接口URL
/open/interval-user-list?token=xxx
请求方式
POST
Content-Type
application/json
请求Query参数
参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 |
---|---|---|---|---|
token | xxx | String | 是 | token |
# 请求Body参数
{
"eventView": {
"endTime": "2021-10-05 23:59:59",
"filts": [
{
"columnDesc": "品牌",
"columnName": "brand",
"comparator": "equal",
"filterType": "SIMPLE",
"ftv": [
"苹果",
"华为"
],
"specifiedClusterDate": "2022-01-24",
"tableType": "event",
"timeUnit": ""
}
],
"groupBy": [
{
"columnDesc": "品牌",
"columnName": "brand",
"propertyRange": "",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
}
],
"recentDay": "114-115",
"relation": "and",
"startTime": "2021-10-04 00:00:00",
"taIdMeasureVo": {
"columnDesc": "用户唯一ID",
"columnName": "#user_id",
"tableType": "event"
},
"timeParticleSize": "day",
"windowsGapUnit": "hour",
"windowsGapValue": 1
},
"events": [
{
"eventName": "activity_attend",
"eventNameDisplay": "",
"filts": [
],
"relation": "and",
"relationProp": {
"property": {
"columnDesc": "品牌",
"columnName": "brand",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
}
},
"type": "first"
},
{
"eventName": "payment",
"eventNameDisplay": "",
"filts": [
],
"relation": "and",
"relationProp": {
"property": {
"columnDesc": "品牌",
"columnName": "brand",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
},
"relationOperatorValue": 0,
"relationPropNumberOperator": "r_eq"
},
"type": "second"
}
],
"projectId": 377,
"timeoutSeconds": 10,
"interval": "2,3",
"sliceDate": "",
"sliceGroupVal": ["苹果", "华为"]
}
# 请求参数说明
参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 |
---|---|---|---|---|
eventView | - | Object | 是 | 分组属性 |
∟ endTime | 2021-10-05 23:59:59 | String | 否 | 结束时间(格式:yyyy-MM-dd HH:mm:ss),相对时间为空时有效 |
∟ filts | - | List | 否 | 全局筛选项 |
∟ columnDesc | 品牌 | String | 否 | 字段显示名 |
∟ columnName | brand | String | 是 | 字段名 |
∟ comparator | equal | String | 是 | 参考: 模型查询API的筛选表达式 |
∟ filterType | SIMPLE | String | 否 | 过滤模式,SIMPLE:简单,COMPOUND:复合 |
∟ ftv | ["苹果"] | List | 否 | 属性对比值 |
∟ specifiedClusterDate | 2022-01-24 | String | 否 | 集群指定日期 |
∟ tableType | event | String | 是 | 表类型,event:事件表,user:用户表 |
∟ timeUnit | String | 否 | 属性对比值单位,仅对relativeEvent*有效:day,hour,minute | |
∟ groupBy | - | List | 否 | 分组属性,可以有零个或者多个 |
∟ columnDesc | 品牌 | String | 否 | 字段显示名 |
∟ columnName | brand | String | 是 | 字段名 |
∟ propertyRange | String | 否 | 自定义属性区间 | |
∟ specifiedClusterDate | 2022-01-24 | String | 否 | 集群指定日期 |
∟ tableType | event | String | 是 | 表类型,event:事件表,user:用户表 |
∟ recentDay | 114-115 | String | 否 | 相对时间(此项不可与起始时间和结束时间同时为空) |
∟ relation | and | String | 否 | 逻辑关系,and:逻辑与,or:逻辑或 |
∟ startTime | 2021-10-04 00:00:00 | String | 否 | 起始时间(格式:yyyy-MM-dd HH:mm:ss),相对时间为空时有效 |
∟ taIdMeasureVo | - | Object | 否 | 分析主体配置 |
∟ columnDesc | 用户唯一ID | String | 否 | 字段显示名 |
∟ columnName | #user_id | String | 是 | 字段名 |
∟ tableType | event | String | 是 | 表类型,event:事件表,user:用户表 |
∟ timeParticleSize | day | String | 是 | 分析的时间单位 minute:按1分钟 minute5:按5分钟(v3.5开始支持) minute10:按10分钟(v3.5开始支持) hour:按小时 day:按天 week:按周 month:按月 total:总计 |
∟ firstDayOfWeek | Integer | 否 | 当timeParticleSize为week时,指定周首日,1:星期一,2:星期二, ..,7:星期日,最小1,最大7 | |
∟ windowsGapUnit | hour | String | 否 | 窗口时长单位 |
∟ windowsGapValue | 1 | Integer | 否 | 窗口时长 |
events | - | List | 是 | 事件指标列表 |
∟ eventName | activity_attend | String | 是 | 事件名称,特别的,可以使用 anyEvent 表示任意事件 |
∟ eventNameDisplay | String | 否 | 事件显示名 | |
∟ filts | - | List | 否 | 条件列表列表 |
∟ relation | and | String | 否 | 逻辑关系,and:逻辑与,or:逻辑或 |
∟ relationProp | - | Object | 否 | 关联属性 |
∟ property | - | Object | 否 | 关联属性 |
∟ columnDesc | 品牌 | String | 否 | 字段显示名 |
∟ columnName | brand | String | 否 | 字段名 |
∟ specifiedClusterDate | 2022-01-24 | String | 否 | 集群指定日期 |
∟ tableType | event | String | 否 | 表类型,event:事件表,user:用户表 |
∟ relationOperatorValue | 0 | Integer | 否 | 关系操作值 |
∟ relationPropNumberOperator | r_eq | String | 否 | 关系操作符, r_eq:相等 r_high:高 r_low:低 |
∟ type | first | String | 是 | 事件类型,first:初始事件,second:回访事件 |
projectId | 377 | Integer | 是 | 项目ID |
timeoutSeconds | 10 | Integer | 否 | 请求超时参数,超时则取消查询任务 |
interval | 2,3 | String | 否 | 区间 |
sliceDate | String | 否 | 日期所在当周 | |
sliceGroupVal | ["苹果", "华为"] | List | 否 | 事件所在分组 |
# 成功响应示例
{
"data": {
"columMeta": {
"country": "国家",
"education": "学历",
"birthdate": "出生日期",
"gender": "性别",
"last_login_time": "last_login_time",
"city": "城市",
"nation": "民族",
"channel": "用户操作类型",
"weight": "体重(KG)",
"#distinct_id": "访客ID",
"firstcharge": "是否首充",
"register_time": "register_time",
"#account_id": "账户ID",
"companynature": "工作单位性质",
"accountbalance": "余额",
"maritalstatus": "婚姻状况",
"interest": "兴趣爱好",
"name": "姓名",
"accountpoint": "积分项",
"rank": "会员等级",
"first_login_time": "first_login_time",
"email": "邮箱",
"height": "身高(CM)"
},
"datalist": [
{
"country": "中国",
"birthdate": "2013-05-21",
"education": "大专",
"last_login_time": "2021-12-04 02:18:46.111",
"gender": "男",
"city": "上海市",
"nation": "汉族",
"#user_id": 795692987887919100,
"channel": "微信",
"weight": "125",
"#distinct_id": "5694fdd8-e1dc-4459-97dd-33b10df01400",
"firstcharge": false,
"register_time": "2021-10-06 00:00:23.000",
"#account_id": "b406f8a7-424d-4909-a08a-7b00191b7493",
"companynature": "国有企业",
"accountbalance": "42606",
"maritalstatus": "未婚",
"interest": [
"旅行",
"运动",
"运动"
],
"accountpoint": "81910",
"name": "UaLEhzdn",
"rank": "金卡",
"first_login_time": "2021-10-06 00:01:56.000",
"email": "ElqqXwdL@thinkingdata.cn",
"height": "174"
},
{
"country": "中国",
"birthdate": "1964-12-26",
"education": "大专",
"last_login_time": "2021-10-05 00:02:35.000",
"gender": "男",
"city": "上海市",
"nation": "汉族",
"#user_id": 795692395992715300,
"channel": "官网",
"weight": "197",
"#distinct_id": "5caf9f1a-3253-4279-9723-49c950a48020",
"firstcharge": true,
"register_time": "2021-10-05 00:00:30.000",
"#account_id": "cb6ab625-f45d-4977-bbae-973ead82acba",
"companynature": "外资",
"accountbalance": "49013",
"maritalstatus": "未婚",
"interest": [
"运动",
"唱歌",
"运动"
]
],
"totalNum": 2
},
"return_code": 0,
"return_message": "success"
}
# 响应参数说明
参数名 | 示例值 | 参数类型 | 参数描述 |
---|---|---|---|
return_code | 0 | Integer | 返回码 |
return_message | success | String | 返回信息 |
data | - | Object | 返回结果 |
∟ datalist | - | List | 用户信息 |
∟ columMeta | - | Map | 字段含义映射 |
∟ totalNum | 2 | Integer | 总数 |
错误响应示例
{
"return_code": -1008,
"return_message": "参数(token)为空"
}
参数名 | 示例值 | 参数类型 | 参数描述 |
---|---|---|---|
return_code | -1008 | Integer | 返回码 |
return_message | 参数(token)为空 | String | 返回信息 |
← 路径分析模型 API 用户属性分析 API →