目录
此内容是否有帮助?

# Distributed Analysis Model API

Call method See Call method description in Open API doc.

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

# Distribution Analysis Query

Interface URL

/open/distribution-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",
    "groupBy":[
      {
        "columnDesc":"education",
        "columnName":"education",
        "propertyRange":"",
        "specifiedClusterDate":"2022-01-24",
        "tableType":"user"
      },
      {
        "columnDesc":"city",
        "columnName":"city",
        "propertyRange":"",
        "specifiedClusterDate":"2022-01-24",
        "tableType":"user"
      }],
    "recentDay":"114-115",
    "startTime":"2021-10-04 00:00:00",
    "taIdMeasureVo":{
      "columnDesc":"only user ID",
      "columnName":"#user_id",
      "tableType":"event"
    },
    "timeParticleSize":"day"
  },
  "events":[
    {
      "customEvent":"activity_attend.TIMES",
      "customFilters":[
      ],
      "eventName":"custom indicator",
      "eventNameDisplay":"",
      "filts":[
        {
          "columnDesc":"city",
          "columnName":"city",
          "comparator":"equal",
          "filterType":"SIMPLE",
          "ftv":[
            "Beijing",
            "Shanghai",
            "Gunagzhou",
            "Shenzhen"],
          "specifiedClusterDate":"2022-01-27",
          "tableType":"user",
          "timeUnit":""
        }],
      "formulation":{
        "formulationDeps":[
          {
            "event":{
              "eventDesc":"attend activity",
              "eventName":"activity_attend"
            }
          }]
      },
      "intervalType":"user_defined",
      "quota":"",
      "quotaIntervalArr":[
        500],
      "relation":"and",
      "type":"customized"
    },
    {
      "analysis":"TOTAL_TIMES",
      "analysisDesc":"total number",
      "eventName":"payment",
      "eventNameDisplay":"",
      "filts":[
      ],
      "intervalType":"def",
      "quota":"",
      "relation":"and",
      "type":"normal"
    }],
  "projectId":377,
  "limit": 2,
  "timeoutSeconds": 10,
  "useCache": true
}

# Request Parameter Description

Parameter name
Sample value
Parameter type
Is required
Parameter description
eventView
-
Object
Yes
Grouping properties
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
groupBy -
List
No
Group attributes, can have zero or more
columnDesc Education
String
No
Field display name
columnName education
String
Yes
Field name
propertyRange String
No
Custom attribute interval
specifiedClusterDate 2022-01-24
String
No
Cluster specified date
tableType user
String
Yes
Table type, event: transaction table, user: user table
recentDay 114-115
String
No
Relative time (this item cannot be empty at the same time as the start time and the end time)
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
Analyze subject configuration
columnDesc User unique ID
String
No
Field display name
columnName #user_id
String
Yes
Field name
tableType event
String
Yes
Table type, event: transaction table, user: user table
timeParticleSize day
String
Yes
Unit of time for analysis
Press 1 minute
Minute 5: Press 5 minutes (v3.5 starts to support)
Minute 10: Press 10 minutes (v3.5 start support)
By the hour
By day
Week: by week
Month: by month
Total: total
events
-
List
Yes
List of event indicators
analysis TOTAL_TIMES
String
No
Analysis angle, see the table below
analysisDesc Total number
String
No
Analysis angle description (display name)
customEvent activity_attend.TIMES
String
No
Custom events
customFilters []
List
No
Custom event filtering
eventName login
String
Yes
Event type, in particular, you can use anyEvent to represent any event
eventNameDisplay String
No
Event display name
filts -
List
No
List of conditions
columnDesc City
String
No
Field display name
columnName city
String
Yes
Field name
comparator equal
String
Yes
Reference: Filtered expression for model query API
filterType SIMPLE
String
No
Filter mode, SIMPLE: simple, COMPOUND: composite
ftv ["Beijing"]
List
No
Property comparison value
specifiedClusterDate 2022-01-27
String
No
Cluster specified date
tableType user
String
Yes
Table type, event: transaction table, user: user table
timeUnit String
No
Filter time unit
formulation -
Object
No
New formula entity
formulationDeps -
List
No
Formula dependence
event -
Object
No
Dependency events
eventDesc Participate in activities
String
No
Event display name
eventName activity_attend
String
Yes
Event type
intervalType user_defined
String
No
Interval interval type
Discrete number
Def: default interval
user_defined: User-defined
quota String
No
Indicator Attributes
quotaIntervalArr [500]
List
No
Indicator range
relation and
String
No
Logical relationship, and: logical and, or: logical or
type normal
String
Yes
Type of indicator,
Normal: positive
Customized: Custom
projectId
0
Integer
Yes
Project ID
limit
2
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

Distribution analysis aggregation method analysis value:

Value
Description
Whether properties are required
TIMES
Number of times
No
NUMBER_OF_DAYS
Number of days
No
NUMBER_OF_HOURS
Number of hours
No
SUM
Sum of values
Yes
AVG
Numerical average
Yes
MAX
Maximum value
Yes
MIN
Numerical minimum
Yes
DISTINCT
Deduplicate number
Yes
TRUE
True number
Yes
FALSE
False number
Yes
IS_NOT_EMPTY
Not an empty number
Yes
IS_EMPTY
Null number
Yes
ARRAY_DISTINCT
List overall deduplicate number
Yes
ARRAY_SET_DISTINCT
Element collection deduplicate number
Yes
ARRAY_ITEM_DISTINCT
List element deduplicate number
Yes
MEDIAN
Median
Yes

# Successful Response Example

{
  "data": {
    "distribution_interval": [
      ",500",
      "500,"
    ],
    "result_generate_time": "2022-01-27 11:25:44",
    "x": [
      "2021-10-04",
      "2021-10-05"
    ],
    "y": {
      "2021-10-04": [
        {
          "groupCols": [
            "total",
            "total"
          ],
          "isTotal": 1,
          "meanwhileValues": [
            "28249",
            "-"
          ],
          "totalMeanwhileValue": "28249",
          "totalUserNum": 1722,
          "values": [
            1722,
            0
          ]
        },
        {
          "groupCols": [
            "others",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "3842",
            "-"
          ],
          "totalMeanwhileValue": "3842",
          "totalUserNum": 235,
          "values": [
            235,
            0
          ]
        },
        {
          "groupCols": [
            "colleges",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "2421",
            "-"
          ],
          "totalMeanwhileValue": "2421",
          "totalUserNum": 154,
          "values": [
            154,
            0
          ]
        },
        {
          "groupCols": [
            "others",
            "Shanghai"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "2518",
            "-"
          ],
          "totalMeanwhileValue": "2518",
          "totalUserNum": 151,
          "values": [
            151,
            0
          ]
        },
        {
          "groupCols": [
            "others",
            "Shenzhen"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "2355",
            "-"
          ],
          "totalMeanwhileValue": "2355",
          "totalUserNum": 142,
          "values": [
            142,
            0
          ]
        },
        {
          "groupCols": [
            "others",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1906",
            "-"
          ],
          "totalMeanwhileValue": "1906",
          "totalUserNum": 116,
          "values": [
            116,
            0
          ]
        },
        {
          "groupCols": [
            "大专",
            "深圳市"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1738",
            "-"
          ],
          "totalMeanwhileValue": "1738",
          "totalUserNum": 107,
          "values": [
            107,
            0
          ]
        },
        {
          "groupCols": [
            "undergraduate",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1720",
            "-"
          ],
          "totalMeanwhileValue": "1720",
          "totalUserNum": 106,
          "values": [
            106,
            0
          ]
        },
        {
          "groupCols": [
            "colleges",
            "Shanghai"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1658",
            "-"
          ],
          "totalMeanwhileValue": "1658",
          "totalUserNum": 101,
          "values": [
            101,
            0
          ]
        },
        {
          "groupCols": [
            "本科",
            "上海市"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1595",
            "-"
          ],
          "totalMeanwhileValue": "1595",
          "totalUserNum": 96,
          "values": [
            96,
            0
          ]
        },
        {
          "groupCols": [
            "Post-graduate",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1315",
            "-"
          ],
          "totalMeanwhileValue": "1315",
          "totalUserNum": 78,
          "values": [
            78,
            0
          ]
        },
        {
          "groupCols": [
            "本科",
            "深圳市"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1276",
            "-"
          ],
          "totalMeanwhileValue": "1276",
          "totalUserNum": 75,
          "values": [
            75,
            0
          ]
        },
        {
          "groupCols": [
            "colleges",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1207",
            "-"
          ],
          "totalMeanwhileValue": "1207",
          "totalUserNum": 75,
          "values": [
            75,
            0
          ]
        },
        {
          "groupCols": [
            "postgraduate",
            "Shanghai"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1032",
            "-"
          ],
          "totalMeanwhileValue": "1032",
          "totalUserNum": 63,
          "values": [
            63,
            0
          ]
        },
        {
          "groupCols": [
            "undergraduate",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "796",
            "-"
          ],
          "totalMeanwhileValue": "796",
          "totalUserNum": 49,
          "values": [
            49,
            0
          ]
        },
        {
          "groupCols": [
            "postgraduate",
            "Shenzhen"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "678",
            "-"
          ],
          "totalMeanwhileValue": "678",
          "totalUserNum": 42,
          "values": [
            42,
            0
          ]
        },
        {
          "groupCols": [
            "postgraduate",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "674",
            "-"
          ],
          "totalMeanwhileValue": "674",
          "totalUserNum": 38,
          "values": [
            38,
            0
          ]
        },
        {
          "groupCols": [
            "PHd",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "514",
            "-"
          ],
          "totalMeanwhileValue": "514",
          "totalUserNum": 33,
          "values": [
            33,
            0
          ]
        },
        {
          "groupCols": [
            "PHd",
            "Shenzhen"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "361",
            "-"
          ],
          "totalMeanwhileValue": "361",
          "totalUserNum": 21,
          "values": [
            21,
            0
          ]
        },
        {
          "groupCols": [
            "PHd",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "327",
            "-"
          ],
          "totalMeanwhileValue": "327",
          "totalUserNum": 20,
          "values": [
            20,
            0
          ]
        },
        {
          "groupCols": [
            "PHd",
            "Shanghai"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "316",
            "-"
          ],
          "totalMeanwhileValue": "316",
          "totalUserNum": 20,
          "values": [
            20,
            0
          ]
        }
      ],
      "2021-10-05": [
        {
          "groupCols": [
            "total",
            "total"
          ],
          "isTotal": 1,
          "meanwhileValues": [
            "24907",
            "-"
          ],
          "totalMeanwhileValue": "24907",
          "totalUserNum": 1503,
          "values": [
            1503,
            0
          ]
        },
        {
          "groupCols": [
            "others",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "3535",
            "-"
          ],
          "totalMeanwhileValue": "3535",
          "totalUserNum": 221,
          "values": [
            221,
            0
          ]
        },
        {
          "groupCols": [
            "others",
            "Shanghai"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "2833",
            "-"
          ],
          "totalMeanwhileValue": "2833",
          "totalUserNum": 162,
          "values": [
            162,
            0
          ]
        },
        {
          "groupCols": [
            "colleges",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "2183",
            "-"
          ],
          "totalMeanwhileValue": "2183",
          "totalUserNum": 130,
          "values": [
            130,
            0
          ]
        },
        {
          "groupCols": [
            "others",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1946",
            "-"
          ],
          "totalMeanwhileValue": "1946",
          "totalUserNum": 116,
          "values": [
            116,
            0
          ]
        },
        {
          "groupCols": [
            "others",
            "Shenzhen"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1743",
            "-"
          ],
          "totalMeanwhileValue": "1743",
          "totalUserNum": 109,
          "values": [
            109,
            0
          ]
        },
        {
          "groupCols": [
            "undergraduate",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1753",
            "-"
          ],
          "totalMeanwhileValue": "1753",
          "totalUserNum": 107,
          "values": [
            107,
            0
          ]
        },
        {
          "groupCols": [
            "colleges",
            "Shanghai"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1606",
            "-"
          ],
          "totalMeanwhileValue": "1606",
          "totalUserNum": 92,
          "values": [
            92,
            0
          ]
        },
        {
          "groupCols": [
            "undergraduate",
            "Shanghai"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1421",
            "-"
          ],
          "totalMeanwhileValue": "1421",
          "totalUserNum": 81,
          "values": [
            81,
            0
          ]
        },
        {
          "groupCols": [
            "undergraduate",
            "Shenzhen"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1093",
            "-"
          ],
          "totalMeanwhileValue": "1093",
          "totalUserNum": 68,
          "values": [
            68,
            0
          ]
        },
        {
          "groupCols": [
            "postgraduate",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "1037",
            "-"
          ],
          "totalMeanwhileValue": "1037",
          "totalUserNum": 65,
          "values": [
            65,
            0
          ]
        },
        {
          "groupCols": [
            "colleges",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "947",
            "-"
          ],
          "totalMeanwhileValue": "947",
          "totalUserNum": 59,
          "values": [
            59,
            0
          ]
        },
        {
          "groupCols": [
            "colleges",
            "Shenzhen"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "963",
            "-"
          ],
          "totalMeanwhileValue": "963",
          "totalUserNum": 58,
          "values": [
            58,
            0
          ]
        },
        {
          "groupCols": [
            "postgraduate",
            "Shanghai"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "698",
            "-"
          ],
          "totalMeanwhileValue": "698",
          "totalUserNum": 42,
          "values": [
            42,
            0
          ]
        },
        {
          "groupCols": [
            "undergraduate",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "608",
            "-"
          ],
          "totalMeanwhileValue": "608",
          "totalUserNum": 39,
          "values": [
            39,
            0
          ]
        },
        {
          "groupCols": [
            "postgraduate",
            "Shenzhen"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "560",
            "-"
          ],
          "totalMeanwhileValue": "560",
          "totalUserNum": 37,
          "values": [
            37,
            0
          ]
        },
        {
          "groupCols": [
            "postgraduate",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "553",
            "-"
          ],
          "totalMeanwhileValue": "553",
          "totalUserNum": 31,
          "values": [
            31,
            0
          ]
        },
        {
          "groupCols": [
            "PHd",
            "Beijing"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "478",
            "-"
          ],
          "totalMeanwhileValue": "478",
          "totalUserNum": 29,
          "values": [
            29,
            0
          ]
        },
        {
          "groupCols": [
            "PHd",
            "Guangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "353",
            "-"
          ],
          "totalMeanwhileValue": "353",
          "totalUserNum": 22,
          "values": [
            22,
            0
          ]
        },
        {
          "groupCols": [
            "PHd",
            "Shangzhou"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "339",
            "-"
          ],
          "totalMeanwhileValue": "339",
          "totalUserNum": 19,
          "values": [
            19,
            0
          ]
        },
        {
          "groupCols": [
            "PHd",
            "Shenzhen"
          ],
          "isTotal": 0,
          "meanwhileValues": [
            "258",
            "-"
          ],
          "totalMeanwhileValue": "258",
          "totalUserNum": 16,
          "values": [
            16,
            0
          ]
        }
      ]
    }
  },
  "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
distribution_interval [",500","500,"]
List
Distribution interval
result_generate_time 2022-01-27 11:25:44
String
Results generation time
x ["2021-10-04"]
List
X-axis information
y -
List
Y-axis information

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

# Distribution Analysis User List

Interface URL

/open/distribution-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

{
  "projectId": 0,
  "eventView": {
    "startTime": "2019-10-28 00:00:00",
    "endTime": "2019-11-26 00:00:00",
    "recentDay": "D31",
    "timeParticleSize": "week",
    "groupBy": [
      {
        "columnName": "#province",
        "tableType": "event"
      }
    ]
  },
  "events": [{
    "analysis": "TIMES",
    "eventName": "consume_item",
    "intervalType": "def",
    "quota": "",
    "relation": "and",
    "filts": [
      {
        "columnName": "#os",
        "comparator": "equal",
        "ftv": [
          "android"
        ],
        "tableType": "event"
      }
    ]
  }],
  "interval": "10,20",
  "sliceDate": "2019-11-18",
  "sliceGroupVal": ["Beijing"],
  "timeoutSeconds": 10
}

# Request Parameter Description

Parameter name
Sample value
Parameter type
Is required
Parameter description
projectId
0
String
Yes
Parameter description
eventView
-
Object
Yes
Group property table
startTime 2019-10-28 00:00:00
String
No
Start time (format: yyyy-MM-dd HH: mm: ss), valid when the relative time is empty
endTime 2019-11-26 00:00:00
String
No
End time (format: yyyy-MM-dd HH: mm: ss), valid when the relative time is empty
recentDay D31
String
No
Relative time (this item cannot be empty at the same time as the start time and the end time)
timeParticleSize week
String
Yes
Unit of time for analysis
Press 1 minute
Minute 5: Press 5 minutes (v3.5 starts to support)
Minute 10: Press 10 minutes (v3.5 start support)
By the hour
By day
Week: by week
Month: by month
Total: total
groupBy -
List
No
Group attributes, can have zero or more
columnName #city
String
Yes
Field name
tableType event
String
Yes
Table type, event: transaction table, user: user table
events
List
Yes
List of event indicators
eventName consume_item
String
Yes
Event type, in particular, you can use anyEvent to represent any event
analysis TIMES
String
No
Analysis types, aggregation operations, see the table below
quota String
No
Indicator attributes (with analysis, meaning which attribute of which analysis angle)
relation and
String
No
Logical relationship, and: logical and, or: logical or
intervalType def
String
Yes
Discrete number
Def: default interval
user_defined: User-defined
filts -
List
No
Filter List
columnName #os
String
Yes
Field name
comparator equal
String
Yes
Reference: Filtered expression for model query API
ftv ["android"]
List
No
Property comparison value
tableType event
String
Yes
Table type, event: transaction table, user: user table
interval
10,20
String
No
[10, 20) hours
sliceDate
"2019-11-18"
String
No
2019-11-18 Week
sliceGroupVal
["Beijing"]
String
Yes
Event location grouping
timeoutSeconds
10
Integer
No
Request timed out parameter, timeout cancels query task

# Successful Response Example

{
  "data": {
    "datalist": [
      {
        "#account_id": "h7784497",
        "#distinct_id": "h14456917",
        "user_level": 13,
        "register_time": "2019-11-24 21:52:38",
        "diamond_num": 1201,
        "latest_login_time": "2019-11-24 23:35:49",
        "channel": "Baidu mobile assistant",
        "#user_id": 3336217
      },
      {
        "#account_id": "h6201359",
        "#distinct_id": "h11516759",
        "user_level": 68,
        "register_time": "2019-06-23 09:25:18",
        "diamond_num": 1686,
        "first_recharge_time": "2019-06-23 09:25:38",
        "latest_login_time": "2019-11-18 23:01:49",
        "channel": "Huangwei App store",
        "#user_id": 2657759
      },
      {
        "#account_id": "g4102426",
        "#distinct_id": "g7618786",
        "user_level": 47,
        "register_time": "2019-07-29 13:58:23",
        "diamond_num": 1,
        "first_recharge_time": "2019-07-29 15:42:20",
        "latest_login_time": "2019-11-24 16:04:03",
        "channel": "Application Treasure",
        "#user_id": 1758186
      }
    ],
    "columMeta": {
      "#account_id": "account ID",
      "#distinct_id": "visitor ID",
      "user_level": "user level",
      "register_time": "register time",
      "diamond_num": "diamond number",
      "first_recharge_time": "first recharge time",
      "latest_login_time": "lastest login time",
      "channel": "channel"
    }
  },
  "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

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