目录
此内容是否有帮助?

# Interval Analysis Model API

As for the call method, please refer to the call method description in Open API

You can read the interval analysis in the user manual to understand the usage scenario.

# Interval Analysis Query

Interface URL

/open/interval-analyze?token=xxx

Request method

POST

Content-Type

application/json

Request Query parameter

Parameter name Sample value Parameter type Is required Parameter description
token
xxx
String
Yes
token

# Request Body Parameter

{
  "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 only 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
}

# Request Parameter Description

Parameter name Sample value Parameter type Is required Parameter description
eventView
-
Object
Yes
Metrics common attribute part
endTime 2021-10-05 23:59:59
String
No
End time (format: yyyy-MM-dd HH: mm: ss), valid when the relative time is empty
filts -
List
No
Global filters parts
columnDesc Brand
String
No
Field display name
columnName brand
String
Yes
Field name
comparator equal
String
Yes
Reference: filtering expression of
model query API
filterType SIMPLE
String
No
Filter mode, SIMPLE: simple, COMPOUND: composite
ftv ["Apple"]
List
No
Property comparative with bound literial
specifiedClusterDate 2022-01-24
String
No
Historical tag version of specified date
tableType event
String
Yes
Table type enumeration
timeUnit String
No
Property filter unit, only valid to relativeEvent*:day,hour,minute
groupBy -
List
No
Group attributes, can have zero or more
columnDesc Brand
String
No
Field display name
columnName brand
String
Yes
Field name
propertyRange String
No
Self-defined property interval
specifiedClusterDate 2022-01-24
String
No
Historical tag version of specified date
tableType event
String
Yes
Table type enumeration
recentDay 114-115
String
No
Relative time (this item cannot be empty at the same time as the start time and the end time)
relation and
String
No
Logical relationship, and: logical and, or: logical or
startTime 2021-10-04 00:00:00
String
No
Start time (format: yyyy-MM-dd HH: mm: ss), valid when the relative time is empty
taIdMeasureVo -
Object
No
Query
ID system configuration
columnDesc User unique ID
String
No
Field display name
columnName #user_id
String
Yes
Field name
tableType event
String
Yes
Table type enumeration
timeParticleSize day
String
Yes
Unit of the time period taken for analysis
day: based on days
week: based on weeks
month: based on months
total: total
firstDayOfWeek Integer
No
When timeParticleSize is week, specify the first day of the week, 1: Monday, 2: Tuesday,.., 7: Sunday, minimum 1, maximum 7
windowsGapUnit hour
String
No
Window duration unit
windowsGapValue 1
Integer
No
Window duration
events
-
List
Yes
Event metric list
eventName activity_attend
String
Yes
The eventName the metric based on, "anyEvent" can be used to represent any event
eventNameDisplay String
No
Self-defined metric display name
filts -
List
No
List of conditions
relation and
String
No
Logical relationship, and: logical and, or: logical or
relationProp -
Object
No
Associated properties
property -
Object
No
Associated properties
columnDesc Brand
String
No
Field display name
columnName brand
String
Yes
Field name
specifiedClusterDate 2022-01-24
String
No
Historical tag version of specified date
tableType event
String
No
Table type enumeration
relationOperatorValue 0
Integer
No
Relational operation value
relationPropNumberOperator r_eq
String
No
Relational operator,
r_eq: equal
r_high:高
r_low:低
type first
String
Yes
Event type, first: initial event, second: return event
projectId
377
Integer
Yes
Project
enumeric identity
limit
10
Integer
No
Maximum number of groups per analysis object, optional parameters, default is 1000, maximum is 10000
timeoutSeconds
10
Integer
No
Request timed out parameter, timeout cancels query task
useCache
true
Boolean
No
Use cache, optional parameter, default is true

# Successful 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 Parameter Description

Parameter name Sample value Parameter type Parameter description
return_code
0
Integer
Return code
return_message
success
String
Return information
data
-
Object
Return result
distributionInterval [",300","300,"]
List
Distribution interval
groupCols [["Apple"], ["Huawei"]]
List
Group
intervalData -
Object
Date data
dateEntities -
List
Date List
dateString 2021-10-04
String
Date
groupEntities -
List
Group List
groups ["Apple"]
List
Group value list
intervalAggValue -
Object
Aggregate value
avgValue 39
Long
Average
eventNum 22564
Long
Number of events
maxValue 374
Long
Maximum
midValue 28
Long
Median
minValue 2
Long
Minimum
quarterValue 16
Long
Upper quartile
threeQuarterValue 49
Long
Lower quartile
userNum 2817
Long
Number of users
intervalDistributions -
List
List of distribution intervals
distribution 300,600
String
Distribution interval
intervalDistributionValue -
Object
Distribution interval value
eventNum 11
Long
Number of events
userNum 11
Long
Number of users
intervalType def
String
Type
Discrete number
Def: default interval
user_defined: User-defined
timeArray ["2021-10-04"]
List
Event list

Error Response Example

{
    "return_code": -1008,
    "return_message": "The parameter (token) is empty"
}
Parameter name Sample value Parameter type Parameter description
return_code
-1008
Integer
Return code
return_message
The parameter (token) is empty
String
Return information

# Interval Analysis Full Data Download

Interface URL

/open/streaming-download/interval-analyze?token=xxx

Request method

POST

Content-Type

application/json

Request Query Parameter

Parameter name Sample value Parameter type Mandatory or not Parameter description
token
xxx
String
Yes
Query
key

# Request Body parameter

{
        "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"
}

# Request Parameter Description

参数名 示例值 参数类型 是否必填 参数描述
eventView
-
Object
Yes
Same parameters as Distribution Analysis
Query
interface
events
-
List
Yes
Same parameters as Distribution Analysis
Query
interface
projectId
377
Integer
Yes
Project numeric identity
format
AGG_TABLE
String
Yes
AGG_TABLE : conversion, DISTRIBUTION_TABLE: conversion distribution
interval
[1]
array
No
Full Metric Interval Range

# Response

Same with the full data download of the interval analysis of the TE system

# Interval Analysis User List

Interface URL

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

Request method

POST

Content-Type

application/json

Request Query Parameter

Parameter name Sample value Parameter type Is required Parameter description
token
xxx
String
Yes
token

# Request Body Parameter

{
  "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 only 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"]
}

# Request Parameter Description

Parameter name Sample value Parameter type Is required Parameter description
eventView
-
Object
Yes
Same parameters as Interval Analysis
Query
interface
events
-
List
Yes
Same parameters as Interval Analysis
Query
interface
projectId
377
Integer
Yes
Project
enumric identity
interval
2,3
String
No
Go to detail by which metric interval
sliceDate
String
No
Go to detail by which date
sliceGroupVal
["Apple", "Huawei"]
List
No
Go to detail by which group
timeoutSeconds
10
Integer
No
Request timed out parameter, timeout cancels
query
task

# Successful Response Example

{
  "data": {
    "columMeta": {
      "country": "country",
      "education": "education",
      "birthdate": "birthdate",
      "gender": "gender",
      "last_login_time": "last_login_time",
      "city": "city",
      "nation": "nation",
      "channel": "channel",
      "weight": "weight(KG)",
      "#distinct_id": "visitor ID",
      "firstcharge": "firstcharge",
      "register_time": "register_time",
      "#account_id": "account ID",
      "companynature": "companynature",
      "accountbalance": "accountbalance",
      "maritalstatus": "maritalstatus",
      "interest": "interest",
      "name": "name",
      "accountpoint": "accountpoint",
      "rank": "rank",
      "first_login_time": "first_login_time",
      "email": "email",
      "height": "height(CM)"
    },
    "datalist": [
      {
        "country": "China",
        "birthdate": "2013-05-21",
        "education": "college"
        "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-own company",
        "accountbalance": "42606",
        "maritalstatus": "single",
        "interest": [
          "travel",
          "sport",
          "sport"
        ],
        "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": "college",
        "last_login_time": "2021-10-05 00:02:35.000",
        "gender": "male",
        "city": "Shanghai",
        "nation": "Han",
        "#user_id": 795692395992715300,
        "channel": "offcial site",
        "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 enterprise",
        "accountbalance": "49013",
        "maritalstatus": "single",
        "interest": [
          "sport",
          "sing",
          "sport"
        ]
    ],
    "totalNum": 2
  },
  "return_code": 0,
  "return_message": "success"
}

# Response Parameter Description

Parameter name Sample value Parameter type Parameter description
return_code
0
Integer
Return code
return_message
success
String
Return information
data
-
Object
Return result
datalist -
List
User Information
columMeta -
Map
Field meaning mapping
totalNum 2
Integer
Total

Error Response Example

{
    "return_code": -1008,
    "return_message": "The parameter (token) is empty"
}
Parameter name Sample value Parameter type Parameter description
return_code
-1008
Integer
Return code
return_message
The parameter (token) is empty
String
Return information

# Download of Interval Analysis User List

Interface URL

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

Request method

POST

Content-Type

application/json

Request Query parameters

Parameter name Sample value Parameter type Mandatory or not Parameter 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"]
}

# Request Parameter Description

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

Same parameters as Interval Analysis
Query
interface
events
-
List

Same parameters as Interval Analysis
Query
interface
projectId
377
Integer

Project enumric identity
interval
2,3
String
Go to detail by which metric interval
sliceDate
2021-10-21
String

Go to detail by which date
sliceGroupVal
["Apple", "Huawei"]
List

Go to detail by which group
selectedColumns
["#account_id"]
array

The columns to be downloaded

# Response

Same with the download of the interval analysis user list of the TE system.