目录
此内容是否有帮助?

# Flow Analysis Model API

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

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

# Flow Analysis Query

Interface URL

/open/Flow-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": {
    "col_limit": 10,
    "from_date": "2021-10-01 00:00:00",
    "recent_day": "",
    "session_interval": 30,
    "session_type": "minute",
    "to_date": "2021-10-02 23:59:59"
  },
  "events": {
    "by_fields": [
      {
        "event_name": "login",
        "field": "browser",
        "range": "",
        "table_type": "event"
      }],
    "event_names": [
      "logout",
      "login"],
    "source_event": {
      "event_name": "login",
      "filter": {
        "filterType": "COMPOUND"
      }
    },
    "source_type": "initial_event",
    "user_filter": {
      "filterType": "COMPOUND",
      "filts": [
        {
          "columnDesc": "city",
          "columnName": "city",
          "comparator": "equal",
          "filterType": "SIMPLE",
          "ftv": [
            "Beijing",
            "Shanghai",
            "Guangzhou",
            "Shenzhen"],
          "specifiedClusterDate": "2022-01-24",
          "tableType": "user"
        }],
      "relation": "and"
    }
  },
  "projectId": 377,
  "timeoutSeconds": 10,
  "useCache": true
}

# Request Parameter Description

Parameter name Sample value Parameter type Is required Parameter description
eventView
-
Object
Yes
Metrics common attribute part
col_limit 10
Integer
Yes
Column limit, between 0 and 20
from_date 2021-10-01 00:00:00
String
No
Start time (format: yyyy-MM-dd HH: mm: ss), valid when the relative time is empty
recent_day String
No
Relative time (this item cannot be empty at the same time as the start time and the end time)
session_interval 30
Integer
Yes
Session interval length
session_type minute
String
Yes
Session duration units: seconds, minutes, hours
to_date 2021-10-02 23:59:59
String
No
End time (format: yyyy-MM-dd HH: mm: ss), valid when the relative time is empty
events
-
List
Yes
Event metric list
by_fields -
List
List
Split by event properties
event_name login
String
Yes
Event name
field browser
String
Yes
Split field
range_type -
String
No
Interval range type
Discrete: number
Def: default interval
user_defined: User-defined
range -
String
No
Interval
range
table_type event
String
Yes
Table type enumeration
event_names ["logout","login"]
String
Yes
The eventNames the metric based on
source_event -
Object
Yes
Source event
event_name login
String
Yes
Event name
filter -
Object
No
Source event filtering
filterType COMPOUND
String
No
Filter mode, SIMPLE: simple, COMPOUND: composite
source_type initial_event
String
Yes
Event type, initial_event
/
termination_event
user_filter -
Object
No
User table filtering
filterType COMPOUND
String
No
Filter mode, SIMPLE: simple, COMPOUND: composite
filts -
List
No
List of conditions
columnDesc app_version
String
No
Field display name
columnName app_version
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 ["V1.0"]
List
No
Property comparative with bound literial
specifiedClusterDate 2022-01-26
String
No
Historical tag version of specified date
tableType event
String
Yes
Table type enumeration
relation and
String
No
Logical relationship, and: logical and, or: logical or
projectId
377
Integer
Yes
Project
enumeric identity
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": {
    "event_name_desc_map": {
      "anyEvent": "any event",
      "login": "login",
      "logout": "logout"
    },
    "links": [
      [
        {
          "source": "0_Chrome^_^login",
          "target": "1_logout",
          "times": 1716
        },
        {
          "source": "0_Safari^_^login",
          "target": "1_logout",
          "times": 765
        },
        {
          "source": "0_Firefox^_^login",
          "target": "1_logout",
          "times": 582
        },
        {
          "source": "0_Wechat built-in browser^_^login",
          "target": "1_logout",
          "times": 403
        },
        {
          "is_wastage": true,
          "source": "0_Chrome^_^login",
          "target": "1_wastage",
          "times": 380
        },
        {
          "is_wastage": true,
          "source": "0_Safari^_^login",
          "target": "1_wastage",
          "times": 195
        },
        {
          "is_wastage": true,
          "source": "0_Firefox^_^login",
          "target": "1_wastage",
          "times": 148
        },
        {
          "is_wastage": true,
          "source": "0_Wechat built-in browser^_^login",
          "target": "1_wastage",
          "times": 89
        }
      ]
    ],
    "nodes": [
      [
        {
          "by_value": "Chrome",
          "event_name": "login",
          "id": "0_Chrome^_^login",
          "times": 2096
        },
        {
          "by_value": "Safari",
          "event_name": "login",
          "id": "0_Safari^_^login",
          "times": 960
        },
        {
          "by_value": "Firefox",
          "event_name": "login",
          "id": "0_Firefox^_^login",
          "times": 730
        },
        {
          "by_value": "Wechat built-in browser",
          "event_name": "login",
          "id": "0_Wechat built-in browser^_^login",
          "times": 492
        }
      ],
      [
        {
          "event_name": "logout",
          "id": "1_logout",
          "times": 3466
        }
      ]
    ],
    "result_generate_time": "2022-01-27 13:44:38"
  },
  "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
message
data
-
Object
Return data
event_name_desc_map -
Map
Event name and event description mapping
links -
List
Relational matrix
source 0_Chrome^_^login
String
Relationship start node
target 1_level_up
String
Relationship end node
times 5106
Integer
Number of times
nodes -
List
Node matrix
id 0_Chrome^_^login
String
Node ID
event_name login
String
Node event name
by_value Chrome
String
Node value
times 30301
Integer
Number of times
result_generate_time 2022-01-24 18:53:26
String
Query result generation time

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

# Flow Analysis User List

Interface URL

/open/Flow-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": {
    "col_limit": 10,
    "from_date": "2019-11-20 00:00:00",
    "to_date": "2019-11-26 00:00:00",
    "recent_day": "1-7",
    "session_interval": 22,
    "session_type": "minute"
  },
  "events": {
    "event_names": [
      "obtain_item",
      "consume_item",
      "obtain_coin"
    ],
    "source_event": {
      "event_name": "consume_item",
      "filter": {
        "filts": [
          {
            "columnName": "#os",
            "comparator": "equal",
            "ftv": [
              "ios"
            ],
            "tableType": "event"
          }
        ],
        "relation": "and"
      }
    },
    "source_type": "initial_event",
    "user_filter": {
      "filts": [
        {
          "columnName": "user_level",
          "comparator": "equal",
          "ftv": [
            "6"
          ],
          "tableType": "user"
        }
      ],
      "relation": "and"
    }
  },
  "next_slice_event_by_values": [
    {
      "slice_event_name": "obtain_coin"
    }
  ],
  "session_level": 2,
  "slice_type": "with_next_specific",
  "slice_event_by_values": [
    {
      "slice_event_name": "obtain_item"
    }
  ],
  "timeoutSeconds": 10
}

# Request Parameter Description

Parameter name Sample value Parameter type Is required Parameter description
projectId
0
String
Yes
Parameter description
eventView
-
Object
Yes
Same parameters as Distribution Analysis
Query
interface
events
List
Yes
Same parameters as Distribution Analysis
Query
interface
next_slice_event_by_values
-
List
No
Subsequent events of nodes
,
required
When
slice_type
is
with_next_specific
slice_event_name obtain_coin
String
No
Event type
session_level
2
Integer
Yes
The
Flow
level at which the node is located (counting from 0)
slice_type
with_next_specific
String
Yes
Subsequent events of nodes
Total: total
with_next: There are subsequent nodes
without_next: No subsequent nodes
with_next_specific: A node with a subsequent event
slice_event_by_values
-
List
No
Node events
slice_event_name obtain_item
String
No
Event type
timeoutSeconds
10
Integer
No
Request timed out parameter, timeout cancels query task

# Successful Response Example

{
  "data": {
    "datalist": [
      {
        "#account_id": "j77444535",
        "#distinct_id": "j143825535",
        "user_level": 6,
        "register_time": "2019-11-22 17:07:12",
        "diamond_num": 1270,
        "latest_login_time": "2019-11-22 18:23:19",
        "channel": "app store",
        "#user_id": 33190535
      }
    ],
    "total_num": 1,
    "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
message
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
message