menu
Is this helpful?

# 간격 분석 모델 API

호출 메서드에 대해서는 오픈 API의 호출 메서드 설명을 참조하시기 바랍니다.

사용 시나리오를 이해하려면 사용자 가이드에서 간격 분석을 참조할 수 있습니다.

# 1. 간격 분석 쿼리

인터페이스 URL

/open/interval-analyze?token=xxx

요청 방법

POST

콘텐츠 유형

application/json

요청 쿼리 파라미터

Parameter name

Sample value

Parameter type

Is required

Parameter description

token

xxx

String

Yes

token

요청 본문 파라미터

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

요청 파라미터 설명

$$Parameter name

Sample value

Parameter type

Is required

Parameter description

eventView

-

Object

Yes

Metrics common attribute part

eventView.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

eventView.filts

-

List

No

Global filters parts

eventView.filts.columnDesc

Brand

String

No

Field display name

eventView.filts.columnName

brand

String

Yes

Field name

eventView.filts.comparator

equal

String

Yes

Reference: filtering expression of model query API

eventView.filts.filterType

SIMPLE

String

No

Filter mode, SIMPLE: simple, COMPOUND: composite

eventView.filts.ftv

["Apple"]

List

No

Property comparative with bound literial

eventView.filts.specifiedClusterDate

2022-01-24

String

No

Historical tag version of specified date

eventView.filts.tableType

event

String

Yes

Table type enumeration

eventView.filts.timeUnit

String

No

Property filter unit, only valid to relativeEvent*:day,hour,minute

eventView.groupBy

-

List

No

Group attributes, can have 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

Self-defined property interval

eventView.groupBy.specifiedClusterDate

2022-01-24

String

No

Historical tag version of specified date

eventView.groupBy.tableType

event

String

Yes

Table type enumeration

eventView.recentDay

114-115

String

No

Relative time (this item cannot be empty at the same time as the start time and the end time)

eventView.relation

and

String

No

Logical relationship, 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), valid when the relative time is empty

eventView.taIdMeasureVo

-

Object

No

Query ID system 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 enumeration

eventView.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

eventView.firstDayOfWeek

Integer

No

When timeParticleSize is week, specify 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 duration

events

-

List

Yes

Event metric list

events.eventName

activity_attend

String

Yes

The eventName the metric based on, "anyEvent" can be used to represent any event

events.eventNameDisplay

String

No

Self-defined metric display name

events.filts

-

List

No

List of conditions

events.relation

and

String

No

Logical relationship, and: logical and, or: logical or

events.relationProp

-

Object

No

Associated properties

events.relationProp.property

-

Object

No

Associated properties

events.relationProp.property.columnDesc

Brand

String

No

Field display name

events.relationProp.property.columnName

brand

String

Yes

Field name

events.relationProp.property.specifiedClusterDate

2022-01-24

String

No

Historical tag version of specified date

events.relationProp.property.tableType

event

String

No

Table type enumeration

events.relationProp.relationOperatorValue

0

Integer

No

Relational operation value

events.relationProp.relationPropNumberOperator

r_eq

String

No

Relational operator,

  • r_eq: equal

  • r_high:高

  • r_low:低

events.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

성공적인 응답 예시

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

응답 파라미터 설명

$$Parameter name

Sample value

Parameter type

Parameter description

return_code

0

Integer

Return code

return_message

success

String

Return information

data

-

Object

Return result

data.distributionInterval

[",300","300,"]

List

Distribution interval

data.groupCols

[["Apple"], ["Huawei"]]

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 value

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

List of distribution intervals

data.intervalData.intervalDistributions.distribution

300,600

String

Distribution interval

data.intervalData.intervalDistributions.intervalDistributionValue

-

Object

Distribution interval value

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

  • Discrete number

  • Def: default interval

  • user_defined: User-defined

data.timeArray

["2021-10-04"]

List

Event list

오류 응답 예시

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

# 2. 간격 분석 전체 데이터 다운로드

인터페이스 URL

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

요청 방법

POST

콘텐츠 유형

application/json

요청 쿼리 파라미터

Parameter name

Sample value

Parameter type

Mandatory or not

Parameter description

token

xxx

String

Yes

Query key

요청 본문 파라미터

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

요청 파라미터 설명

$$Parameter name

Sample value

Parameter type

Is required

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

응답

TE 시스템의 간격 분석 전체 데이터 다운로드와 동일함

# 3. 간격 분석 유저 목록

인터페이스 URL

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

요청 방법

POST

콘텐츠 유형

application/json

요청 쿼리 파라미터

Parameter name

Sample value

Parameter type

Is required

Parameter description

token

xxx

String

Yes

token

요청 본문 파라미터

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

요청 파라미터 설명

$$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

성공적인 응답 예시

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

응답 파라미터 설명

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

오류응답 예시

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

# 4. 간격 분석 유저 목록 다운로드

인터페이스 URL

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

요청 방법

POST

콘텐츠 유형

application/json

요청 쿼리 파라미터

Parameter name

Sample value

Parameter type

Mandatory or not

Parameter description

token

xxx

String

Yes

Query key

요청 본문 파라미터

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

요청 파라미터 설명

$$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

Go to detail by which metric interval

sliceDate

2021-10-21

String

No

Go to detail by which date

sliceGroupVal

["Apple", "Huawei"]

List

No

Go to detail by which group

selectedColumns

["#account_id"]

array

Yes

The columns to be downloaded

응답

TE 시스템의 간격 분석 유저 목록 다운로드와 동일함