Interval Analysis model API
For how to call the API, see the calling method described in the Open API document.
See Interval Analysis in the user guide to learn about use cases.
1. Interval Analysis query
Endpoint URL
/open/interval-analyze?token=xxx
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
Request body parameters
{
"eventView": {
"endTime": "2021-10-05 23:59:59",
"filts": [
{
"columnDesc": "Brand",
"columnName": "brand",
"comparator": "equal",
"filterType": "SIMPLE",
"ftv": [
"Apple",
"Huawei"
],
"specifiedClusterDate": "2022-01-24",
"tableType": "event",
"timeUnit": ""
}
],
"groupBy": [
{
"columnDesc": "Brand",
"columnName": "brand",
"propertyRange": "",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
}
],
"recentDay": "114-115",
"relation": "and",
"startTime": "2021-10-04 00:00:00",
"taIdMeasureVo": {
"columnDesc": "User unique ID",
"columnName": "#user_id",
"tableType": "event"
},
"timeParticleSize": "day",
"windowsGapUnit": "hour",
"windowsGapValue": 1
},
"events": [
{
"eventName": "activity_attend",
"eventNameDisplay": "",
"filts": [
],
"relation": "and",
"relationProp": {
"property": {
"columnDesc": "Brand",
"columnName": "brand",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
}
},
"type": "first"
},
{
"eventName": "payment",
"eventNameDisplay": "",
"filts": [
],
"relation": "and",
"relationProp": {
"property": {
"columnDesc": "Brand",
"columnName": "brand",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
},
"relationOperatorValue": 0,
"relationPropNumberOperator": "r_eq"
},
"type": "second"
}
],
"projectId": 377,
"limit": 10,
"timeoutSeconds": 10,
"useCache": true,
"zoneOffset": 10
}
Request parameters
| $$Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| eventView | - | Object | Yes | Common properties of the metrics |
| eventView.endTime | 2021-10-05 23:59:59 | String | No | End time (format: yyyy-MM-dd HH:mm:ss). Takes effect when the relative time is empty |
| eventView.filts | - | List | No | Global filters |
| eventView.filts.columnDesc | Brand | String | No | Field display name |
| eventView.filts.columnName | brand | String | Yes | Field name |
| eventView.filts.comparator | equal | String | Yes | See Filter expressions in the Query API |
| eventView.filts.filterType | SIMPLE | String | No | Filter mode. SIMPLE: simple, COMPOUND: compound |
| eventView.filts.ftv | ["Apple"] | List | No | Literal constants used as boundaries for property comparison |
| eventView.filts.specifiedClusterDate | 2022-01-24 | String | No | Uses the historical version of the tag for the specified date |
| eventView.filts.tableType | event | String | Yes | Table type enum values |
| eventView.filts.timeUnit | String | No | Unit of the property comparison value, valid only for relativeEvent*: day, hour, minute | |
| eventView.groupBy | - | List | No | Group-by properties. There can be zero or more |
| eventView.groupBy.columnDesc | Brand | String | No | Field display name |
| eventView.groupBy.columnName | brand | String | Yes | Field name |
| eventView.groupBy.propertyRange | String | No | Custom property range | |
| eventView.groupBy.specifiedClusterDate | 2022-01-24 | String | No | Uses the historical version of the tag for the specified date |
| eventView.groupBy.tableType | event | String | Yes | Table type enum values |
| eventView.recentDay | 114-115 | String | No | Relative time (this item, the start time, and the end time can't all be empty) |
| eventView.relation | and | String | No | Logical relation. and: logical AND, or: logical OR |
| eventView.startTime | 2021-10-04 00:00:00 | String | No | Start time (format: yyyy-MM-dd HH:mm:ss). Takes effect when the relative time is empty |
| eventView.taIdMeasureVo | - | Object | No | Analysis entity configuration |
| eventView.taIdMeasureVo.columnDesc | User Unique ID | String | No | Field display name |
| eventView.taIdMeasureVo.columnName | #user_id | String | Yes | Field name |
| eventView.taIdMeasureVo.tableType | event | String | Yes | Table type enum values |
| eventView.timeParticleSize | day | String | Yes | The time unit of the analysis
|
| eventView.firstDayOfWeek | Integer | No | When timeParticleSize is week, specifies the first day of the week. 1: Monday, 2: Tuesday, .., 7: Sunday. Minimum 1, maximum 7 | |
| eventView.windowsGapUnit | hour | String | No | Window duration unit |
| eventView.windowsGapValue | 1 | Integer | No | Window length |
| events | - | List | Yes | List of event metrics |
| events.eventName | activity_attend | String | Yes | Event name. In particular, you can use anyEvent to represent any event |
| events.eventNameDisplay | String | No | Event display name | |
| events.filts | - | List | No | List of conditions |
| events.relation | and | String | No | Logical relation. and: logical AND, or: logical OR |
| events.relationProp | - | Object | No | Associated property |
| events.relationProp.property | - | Object | No | Associated property |
| events.relationProp.property.columnDesc | Brand | String | No | Field display name |
| events.relationProp.property.columnName | brand | String | No | Field name |
| events.relationProp.property.specifiedClusterDate | 2022-01-24 | String | No | Uses the historical version of the tag for the specified date |
| events.relationProp.property.tableType | event | String | No | Table type enum values |
| events.relationProp.relationOperatorValue | 0 | Integer | No | Relational operation value |
| events.relationProp.relationPropNumberOperator | r_eq | String | No | Relational operator:
|
| events.type | first | String | Yes | Event type. first: starting event, second: ending event |
| projectId | 377 | Integer | Yes | Project ID |
| limit | 10 | Integer | No | Maximum number of groups per analysis object. Optional. Defaults to 1000, with a maximum of 10000 |
| timeoutSeconds | 10 | Integer | No | Request timeout. The query task is canceled when it times out |
| useCache | true | Boolean | Yes | true means the cache is used |
| zoneOffset | 10 | Integer | No | Time zone |
Success response example
{
"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": [
[
"Apple"
],
[
"Huawei"
]
],
"intervalData": {
"dateEntities": [
{
"dateString": "2021-10-04",
"groupEntities": [
{
"groups": [
"Apple"
],
"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": [
"Huawei"
],
"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": [
"Apple"
],
"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": [
"Huawei"
],
"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": [
"Apple"
],
"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": [
"Huawei"
],
"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"
}
Response parameters
| $$Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
| data | - | Object | Returned result |
| data.distributionInterval | [",300","300,"] | List | Distribution intervals |
| data.groupCols | [["Apple"],["Huawei"]] | List<List> | Group |
| data.intervalData | - | Object | Date data |
| data.intervalData.dateEntities | - | List | Date list |
| data.intervalData.dateEntities.dateString | 2021-10-04 | String | Date |
| data.intervalData.groupEntities | - | List | Group list |
| data.intervalData.groupEntities.groups | ["Apple"] | List | Group value list |
| data.intervalData.intervalAggValue | - | Object | Aggregate values |
| data.intervalData.intervalAggValue.avgValue | 39 | Long | Average |
| data.intervalData.intervalAggValue.eventNum | 22564 | Long | Number of events |
| data.intervalData.intervalAggValue.maxValue | 374 | Long | Maximum |
| data.intervalData.intervalAggValue.midValue | 28 | Long | Median |
| data.intervalData.intervalAggValue.minValue | 2 | Long | Minimum |
| data.intervalData.intervalAggValue.quarterValue | 16 | Long | Upper quartile |
| data.intervalData.intervalAggValue.threeQuarterValue | 49 | Long | Lower quartile |
| data.intervalData.intervalAggValue.userNum | 2817 | Long | Number of users |
| data.intervalData.intervalDistributions | - | List | Distribution range list |
| data.intervalData.intervalDistributions.distribution | 300,600 | String | Distribution range |
| data.intervalData.intervalDistributions.intervalDistributionValue | - | Object | Distribution range values |
| data.intervalData.intervalDistributions.intervalDistributionValue.eventNum | 11 | Long | Number of events |
| data.intervalData.intervalDistributions.intervalDistributionValue.userNum | 11 | Long | Number of users |
data.intervalType | def | String | Type
|
| data.timeArray | ["2021-10-04"] | List | Event list |
Error response example
{
"return_code": -1008,
"return_message": "Parameter (token) is empty"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1008 | Integer | Return code |
| return_message | Parameter (token) is empty | String | Return message |
2. Interval Analysis full download
Endpoint URL
/open/streaming-download/interval-analyze?token=xxx
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
Request body parameters
{
"eventView": {
"endTime": "2022-03-07 17:17:04",
"filts": [],
"groupBy": [],
"recentDay": "1-7",
"relation": "and",
"startTime": "2022-03-01 17:17:04",
"taIdMeasureVo": {
"columnDesc": "User ID",
"columnName": "#user_id",
"tableType": "event"
},
"timeParticleSize": "day",
"windowsGapUnit": "hour",
"windowsGapValue": 1
},
"events": [{
"eventName": "Login",
"eventNameDisplay": "",
"filts": [],
"relation": "and",
"type": "first"
}, {
"eventName": "Recharge",
"eventNameDisplay": "",
"filts": [],
"relation": "and",
"type": "second"
}],
"projectId": 319,
"format": "AGG_TABLE",
"zoneOffset": 10
}
Request parameters
| $$Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| eventView | - | Object | Yes | Common properties of the metrics. The parameters are the same as those of the Interval Analysis query API |
| events | - | List | Yes | List of event metrics |
| projectId | 377 | Integer | Yes | Project ID |
| format | AGG_TABLE | String | Yes | AGG_TABLE box plot converted to a table DISTRIBUTION_TABLE distribution converted to a table |
| interval | [1] | array | No | All ranges |
| zoneOffset | 10 | Integer | No | Time zone |
Response
Same as the full download of Interval Analysis in the AE system
3. Interval Analysis user list
Endpoint URL
/open/interval-user-list?token=xxx
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
Request body parameters
{
"eventView": {
"endTime": "2021-10-05 23:59:59",
"filts": [
{
"columnDesc": "Brand",
"columnName": "brand",
"comparator": "equal",
"filterType": "SIMPLE",
"ftv": [
"Apple",
"Huawei"
],
"specifiedClusterDate": "2022-01-24",
"tableType": "event",
"timeUnit": ""
}
],
"groupBy": [
{
"columnDesc": "Brand",
"columnName": "brand",
"propertyRange": "",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
}
],
"recentDay": "114-115",
"relation": "and",
"startTime": "2021-10-04 00:00:00",
"taIdMeasureVo": {
"columnDesc": "User unique ID",
"columnName": "#user_id",
"tableType": "event"
},
"timeParticleSize": "day",
"windowsGapUnit": "hour",
"windowsGapValue": 1
},
"events": [
{
"eventName": "activity_attend",
"eventNameDisplay": "",
"filts": [
],
"relation": "and",
"relationProp": {
"property": {
"columnDesc": "Brand",
"columnName": "brand",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
}
},
"type": "first"
},
{
"eventName": "payment",
"eventNameDisplay": "",
"filts": [
],
"relation": "and",
"relationProp": {
"property": {
"columnDesc": "Brand",
"columnName": "brand",
"specifiedClusterDate": "2022-01-24",
"tableType": "event"
},
"relationOperatorValue": 0,
"relationPropNumberOperator": "r_eq"
},
"type": "second"
}
],
"projectId": 377,
"timeoutSeconds": 10,
"interval": "2,3",
"sliceDate": "",
"sliceGroupVal": ["Apple", "Huawei"],
"zoneOffset": 10
}
Request parameters
| $$Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| eventView | - | Object | Yes | The parameters are the same as those of the Interval Analysis query API |
| events | - | List | Yes | The parameters are the same as those of the Interval Analysis query API |
| projectId | 377 | Integer | Yes | Project ID |
| timeoutSeconds | 10 | Integer | No | Request timeout. The query task is canceled when it times out |
| interval | 2,3 | String | No | Range to drill down into |
| sliceDate | 2021-10-21 | String | No | Date to drill down into |
| sliceGroupVal | ["Apple", "Huawei"] | List | No | Group to drill down into |
| zoneOffset | 10 | Integer | No | Time zone |
Success response example
{
"data": {
"columMeta": {
"country": "Country",
"education": "Education",
"birthdate": "Date of birth",
"gender": "Gender",
"last_login_time": "last_login_time",
"city": "City",
"nation": "Ethnicity",
"channel": "User operation type",
"weight": "Weight (KG)",
"#distinct_id": "Distinct ID",
"firstcharge": "First top-up",
"register_time": "register_time",
"#account_id": "Account ID",
"companynature": "Employer type",
"accountbalance": "Balance",
"maritalstatus": "Marital status",
"interest": "Interests",
"name": "Name",
"accountpoint": "Points",
"rank": "Membership level",
"first_login_time": "first_login_time",
"email": "Email",
"height": "Height (CM)"
},
"datalist": [
{
"country": "China",
"birthdate": "2013-05-21",
"education": "Associate degree",
"last_login_time": "2021-12-04 02:18:46.111",
"gender": "Male",
"city": "Shanghai",
"nation": "Han",
"#user_id": 795692987887919100,
"channel": "WeChat",
"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": "State-owned enterprise",
"accountbalance": "42606",
"maritalstatus": "Single",
"interest": [
"Travel",
"Sports",
"Sports"
],
"accountpoint": "81910",
"name": "UaLEhzdn",
"rank": "Gold",
"first_login_time": "2021-10-06 00:01:56.000",
"email": "ElqqXwdL@thinkingdata.cn",
"height": "174"
},
{
"country": "China",
"birthdate": "1964-12-26",
"education": "Associate degree",
"last_login_time": "2021-10-05 00:02:35.000",
"gender": "Male",
"city": "Shanghai",
"nation": "Han",
"#user_id": 795692395992715300,
"channel": "Official website",
"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": "Foreign-owned",
"accountbalance": "49013",
"maritalstatus": "Single",
"interest": [
"Sports",
"Singing",
"Sports"
]
}
],
"totalNum": 2
},
"return_code": 0,
"return_message": "success"
}
Response parameters
| $$Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
| data | - | Object | Returned result |
| data.datalist | - | List<Map> | User information |
| data.columMeta | - | Map | Mapping of field meanings |
| data.totalNum | 2 | Integer | Total count |
Error response example
{
"return_code": -1008,
"return_message": "Parameter (token) is empty"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1008 | Integer | Return code |
| return_message | Parameter (token) is empty | String | Return message |
4. Interval Analysis user list download
Endpoint URL
/open/streaming-download/interval-user-list?token=xxx
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
Request body parameters
{
"eventView": {
"endTime": "2022-03-07 17:17:04",
"filts": [],
"groupBy": [],
"recentDay": "1-7",
"relation": "and",
"startTime": "2022-03-01 17:17:04",
"taIdMeasureVo": {
"columnDesc": "User ID",
"columnName": "#user_id",
"tableType": "event"
},
"timeParticleSize": "day",
"windowsGapUnit": "hour",
"windowsGapValue": 1
},
"events": [
{
"eventName": "Login",
"eventNameDisplay": "",
"filts": [],
"relation": "and",
"type": "first"
},
{
"eventName": "Recharge",
"eventNameDisplay": "",
"filts": [],
"relation": "and",
"type": "second"
}
],
"projectId": 319,
"sliceGroupVal": null,
"sliceDate": "2022-03-01",
"selectedColumns": [
"#account_id",
"#distinct_id",
"accountid"
],
"zoneOffset": 10
}
Request parameters
| $$Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| eventView | - | Object | Yes | The parameters are the same as those of the Interval Analysis query API |
| events | - | List | Yes | The parameters are the same as those of the Interval Analysis query API |
| projectId | 377 | Integer | Yes | Project ID |
| selectedColumns | ["#account_id"] | array | Yes | Items to download |
| interval | 2,3 | String | Range to drill down into | |
| sliceDate | 2021-10-21 | String | No | Date to drill down into |
| sliceGroupVal | ["Apple", "Huawei"] | List | No | Group to drill down into |
| zoneOffset | 10 | Integer | No | Time zone |
Response
Same as the user list download of Interval Analysis in the AE system

