menu
Is this helpful?

# Metadata Management API

For the call method, see the call method description in the Open API document.

It is recommended to read the metadata management section of the TE user manual first to understand the relevant functions: Data Management

# I. Event Management

# Query Virtual Events

Interface URL

/open/get-virtual-event-by-name?token=xxx&projectId=377&eventName=ta@test222

Request method

GET

Content-Type

application/json

Request Query Parameter

Parameter name Sample value Parameter type Is required Parameter description
token xxx String Yes token
projectId 377 Integer Yes Project ID
eventName ta@test222 String Yes Event type

Successful Response Example

{
    "data": {
        "eventDesc": "Test virtual events",
        "eventName": "ta@teset",
        "remark": "",
        "rule": {
            "events": [
                {
                    "eventDesc": "obtain coin",
                    "eventName": "obtain_coin",
                    "filter": {
                        "filterType": "COMPOUND",
                        "filts": [],
                        "relation": "and"
                    }
                }
            ],
            "filter": {
                "filterType": "COMPOUND",
                "filts": [],
                "relation": "and"
            }
        }
    },
    "return_code": 0,
    "return_message": "success"
}
$$Parameter name Sample value Parameter type Parameter description
data - Object Return data
data.eventDesc Test virtual events String Event description
data.eventName ta@teset String Event name
data.remark - String Event remarks
data.rule - Object Virtual event rules
data.rule.events - List Event list
data.rule.events.eventDesc Get gold coins String Event description
data.rule.events.eventName obtain_coin String Event name
data.rule.events.filter - Object Attribute filter
data.rule.events.filter.filterType COMPOUND String Filters,
  • COMPOUND: composite type

  • SIMPLE: Simple type

data.rule.events.filter filts [] List Filter value list
data.rule.events.filter relation and String Filter logical relationships
data.rule.filter - Object Attribute filter
data.rule.filter.filterType COMPOUND String Filters,
  • COMPOUND: composite type

  • SIMPLE: Simple type

data.rule.filter.filts [] List Filtered value list
data.rule.filter.relation and String Filter logical relationships
return_code 0 Integer Return code
return_message success String Return information

# Event Element Information List

Interface URL

/open/list-event-meta?token=xxx&projectId=377

Request method

GET

Content-Type

application/json

Request Query Parameter

#
Parameter name Sample value Parameter type Is required Parameter description
token xxx String Yes token
projectId 377 Integer Yes Project ID
propName

String No The name of the property, which is used to query property-related events. All physical and virtual events are returned when not present

Successful Response Example

{
    "data": {
        "events": [
            {
                "eventDesc": "attand activity",
                "eventName": "activity_attend",
                "eventTag": "111,aaa",
                "eventType": "event",
                "isHide": false,
                "remark": "attand activity 321"
            }
        ]
    },
    "return_code": 0,
    "return_message": "success"
}
$$Parameter name Sample value Parameter type Parameter description
data - Object Return data
data.events - List Event list
data.events.eventDesc Participate in activities String Event description
data.events.eventName activity_attend String Event name
data.events.eventTag 111,aaa String Event tags
data.events.eventType event String Event type
  • event: physical event

  • event_v: virtual events

data.events.isHide false Boolean Whether to hide
data.events.remark Participate in activities 321 String Event remarks
return_code 0 Integer Return code
return_message success String Return information

# Create Virtual Events

Interface URL

/open/create-virtual-event?token=xxx&projectId=0&override=false

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
projectId 0 Integer Yes Project ID
override false String Yes If a virtual event with the same name already exists, an error will be reported when 'override' is false, and the virtual event definition will be updated when it is true.

Request Body Parameter

{
  "eventName": "ta@test_vevent",
  "eventDesc": "test virtual event",
  "remark": "",
  "rule": {
    "events": [
      {
        "eventDesc": "attend activity",
        "eventName": "activity_attend",
        "filter": {
          "relation": "and",
          "filts": [
            {
              "comparator": "equal",
              "columnDesc": "network type",
              "columnName": "network",
              "ftv": [
                "4G"
              ],
              "selectType": "string",
              "tableType": "event"
            }
          ]
        }
      }
    ]
  }
}
$$Parameter name Sample value Parameter type Is required Parameter description
eventName ta@test_vevent String Yes Event name
eventDesc Test virtual events String No Event description
remark String No Event remarks
rule - Object Yes Rules
rule.events - List Yes Event list
rule.events.eventName activity_attend String Yes Event type
rule.events.eventDesc Participate in activities String No Event description
rule.events.filter - Object No Attribute filter
rule.events.filter.filterType SIMPLE String No Filter
  • COMPOUND: composite type

  • SIMPLE: simple type

rule.events.filter.filts - List No Filter object list
rule.events.filter.filts.comparator equal String No Comparison type
rule.events.filter.filts.columnDesc Network Type String No Field description
rule.events.filter.filts.columnName network String Yes Field name
rule.events.filter.filts.ftv ["4G"] List No Filtered value list
rule.events.filter.filts.selectType string String No Filter value filter box type
rule.events.filter.filts.tableType event String No Event: event attribute, user: user feature
rule.events.filter.filts.filterType SIMPLE String No Filters,
  • COMPOUND: composite type

  • SIMPLE: Simple type

rule.events.filter.relation and String No Filter logical relationships

Successful Response Example

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

Error Response Example

{
    "return_code": -1008,
    "return_message": "eventName cannot be empty,rule cannot be null"
}
Parameter name Sample value Parameter type Parameter description
return_code -1008 Integer Return code
return_message EventName cannot be null, rule cannot be null String Return information

# Modify Event Description

TIP

  • The maximum length of the event description is 60 characters, and the excess part will be truncated automatically.
  • Event description cannot contain emoji.
  • The virtual event description cannot be duplicated with other virtual event descriptions and event names.
  • The physical event display name cannot be duplicated with other physical event descriptions and event names.

Interface URL

/open/update-event-info?token=xxx&projectId=0

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
projectId 0 Integer Yes Project ID

Request Body Parameter

{
    "eventName": "test007",
    "eventDesc": "testDesc"
}
Parameter name Sample value Parameter type Is required Parameter description
eventName test String Yes Event name
eventDesc testDesc String Yes Event description

Successful Response Example

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

Error Response Example

{
    "return_code": -1008,
    "return_message": "Event test007 has been hidden or deleted, please reset the condition"
}
Parameter name Sample value Parameter type Parameter description
return_code -1008 Integer Return code
return_message Event test007 has been hidden or deleted, please reset conditions String Return information

# Delete Virtual Events

Interface URL

/open/delete-virtual-event-by-name?token=xxx&projectId=0&eventName=test

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
projectId 0 Integer Yes Project ID
eventName test String Yes Event type

Successful Response Example

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

Error Response Example

{
    "return_code": -1008,
    "return_message": "Event test has been hidden or deleted, please reset the condition"
}
Parameter name Sample value Parameter type Parameter description
return_code -1008 String Return code
return_message Event test has been hidden or deleted, please reset conditions String Return information

# II. Attribute Management

# Query Virtual Properties

Interface URL

/open/get-sql-prop-by-name?token=xxx&projectId=0&propName=%23vp@location&tableType=event

Request method

GET

Content-Type

application/json

Request Query Parameter

Parameter name Sample value Parameter type Is required Parameter description
token xxx String Yes token
projectId 0 Integer Yes Project ID
propName #vp@location String Yes Attribute name
tableType event String Yes Event: event attribute, user: user feature

Successful Response Example

{
    "data": {
        "relatedEvents": [
            {
                "eventName": "event name",
                "eventDesc": "event display name"
            }
        ],
        "sqlEventRelationType": "relation_default",
        "sqlExpression": "concat(\"#country\",'-',\"#province\",'-',\"#city\")",
        "vProp": {
            "property": {
                "columnDesc": "location information",
                "columnName": "#vp@location",
                "selectType": "string",
                "tableType": "event"
            }
        }
    },
    "return_code": 0,
    "return_message": "success"
}
$$Parameter name Sample value Parameter type Parameter description
data - Object Return data
data.relatedEvents - List List of associated events
data.relatedEvents.eventName Event type String Event type
data.relatedEvents.eventDesc Event display name String Event display name
data.sqlEventRelationType relation_default String
  • relation_default: Automatically parse related matters

  • relation_always: All events are related

  • relation_by_setting: Related events in relatedEvents

data.sqlExpression concat("#country",'-',"#province",'-',"#city") String SQL expression
data.vProp - Object Virtual property list
data.vProp.property - Object Virtual properties
data.vProp.property.columnDesc Location information String Field display name
data.vProp.property.columnName #vp@location String Field name
data.vProp.property.selectType string String Filter value filter box type
data.vProp.property.tableType event String Attribute type
  • Event: event attributes

  • User: user features

return_code 0 Integer Return code
return_message success String Return information

Error Response Example

{
    "return_code": -1008,
    "return_message": "User property test007 has been hidden or deleted, please reset the condition"
}
Parameter name Sample value Parameter type Parameter description
return_code -1008 Integer Return code
return_message User feature test007 has been hidden or deleted, please reset conditions String Return information

# Attribute List

Interface URL

/open/list-props?token=xxx&projectId=0&tableType=event&eventName

Request method

GET

Content-Type

application/json

Request Query Parameter

Parameter name Sample value Parameter type Is required Parameter description
token xxx String Yes token
projectId 0 Integer Yes Project ID
tableType event String Yes Attribute type
  • Event: event attributes

  • User: user features

eventName - String No TableType is valid when it is an event. The name of the physical or virtual event, this parameter is used to query the event-related properties. All physical and virtual properties are returned when not passed

Successful Response Example

{
    "data": {
        "properties": [
            {
                "canCreateDict": true,
                "columnDesc": "activity name def:123123123123123123",
                "columnName": "activity_item_operation",
                "columnRemark": "",
                "dictProps": [
                    {
                        "canCreateDict": false,
                        "columnDesc": "",
                        "columnName": "activity_item_operation@channel_name",
                        "columnRemark": "",
                        "isHide": false,
                        "propType": "vprop_dict",
                        "selectType": "string",
                        "tableType": "event"
                    }
                ],
                "isHide": false,
                "propType": "prop_unpreset",
                "selectType": "string",
                "tableType": "event"
            }
        ]
    },
    "return_code": 0,
    "return_message": "success"
}
$$Parameter name Sample value Parameter type Parameter description
data - Object Return data
data.properties - List
data.properties.canCreateDict true Boolean Can I create a dimension table?
data.properties.columnDesc Activity item def: 123123123123123123 String Field display name
data.properties.columnName activity_item_operation String Field name
data.properties.columnRemark - String Field description
data.properties.dictProps - List Associated dimension field
data.properties.dictProps.canCreateDict false String Can I create a dimension table?
data.properties.dictProps.columnDesc - String Field display name
data.properties.dictProps.columnName activity_item_operation@channel_name String Field name
data.properties.dictProps.columnRemark - String Field description
data.properties.dictProps.isHide false Boolean Whether to hide
data.properties.dictProps.propType vprop_dict String Attribute type
data.properties.dictProps.selectType string String Filter value filter box type
data.properties.dictProps.tableType event String The field belongs to the table type
data.properties.isHide false Boolean Whether to hide
data.properties.propType prop_unpreset String Attribute type
  • prop_preset: Prefabricated physical properties

  • prop_unpreset: Custom physical properties

  • vprop_dict: Dimension table attributes based on physical attributes

  • vprop_sql: Virtual properties based on physical properties

  • vprop_dict_v: Dimension table attributes based on virtual attributes

  • vprop_sql_v: Virtual properties based on dimension table properties

data.properties.selectType string String Filter value filter box type
data.properties.tableType event String The field belongs to the table type
return_code 0 Integer Return code
return_message success String Return information

# Modify Attribute Display Name

TIP

  1. The maximum attribute display name is 60 characters, the excess part is automatically truncated, and emoji expressions cannot be included. Virtual attributes cannot have the same name as other virtual attributes, and physical attributes cannot have the same name as other physical attributes.
  2. Property description is up to 200 characters long, and the excess part is automatically truncated.
  3. Update the virtual property definition if the virtual property with the same name already exists.

Interface URL

/open/update-prop-info?token=xxx&projectId=0

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
projectId 0 Integer Yes Project ID

Request Body Parameter

{
    "columnName": "test",
    "columnDesc": "testDesc",
    "columnRemark": "testRemark",
    "tableType": "event"
}
Parameter name Sample value Parameter type Is required Parameter description
columnName test String Yes Field name
columnDesc testDesc String Yes Field display name
columnRemark testRemark String No Field description
tableType testType String Yes Attribute type
  • Event: event attributes

  • User: user features

Successful Response Example

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

Error Response Example

{
    "return_code": -1023,
    "return_message": "event property(test) does not exist"
}
Parameter name Sample value Parameter type Parameter description
return_code -1023 Integer Return code
return_message Event property (test) does not exist String Return information

# Dimension Dictionary Checksum and Creation

note

File upload method to create a dimension dictionary, file size limit 200M

Interface URL

/open/dict-create?token=xxx&projectId=0&createParam=test

Request method

POST

Content-Type

text/csv

Request Query Parameter

Parameter name Sample value Parameter type Is required Parameter description
token xxx String Yes token
projectId 0 Integer Yes Project ID
createParam test String Yes -

Successful Response Example

{
    "data": {
        "totalLineNum": 4,
        "successLineNum": 1,
        "duplcatedMainKeyLineNum": 1,
        "duplcatedMainKeyColumns": ["city@test"],
        "mainKeyErrorLineNum": 1,
        "mainKeyErrorColumns": ["brand@quantity"],
        "typeErrorLineNum": 1,
        "typeErrorColumns": ["iswin@num"],
        "repeatWithConlumnName": [{
            "columnName": "channel@channel_name",
            "columnDesc": "channel type"
        }],
        "repeatWithConlumnDesc": [{
            "columnName": "channel@channel_name",
            "columnDesc": "channel type"
        }]
    },
    "return_code": 0,
    "return_message": "success"
}
$$Parameter name Sample value Parameter type Parameter description
return_code 0 String Return code
return_message success String Return information
data - Object Return data
data.totalLineNum 4 Integer Total number of parsed rows
data.successLineNum 1 Integer Number of rows successfully imported
data.duplcatedMainKeyLineNum 1 Integer Number of rows repeating primary key
data.duplcatedMainKeyColumns ["city@test"] List List of rows with duplicate primary keys
data.mainKeyErrorLineNum 1 Integer Number of rows of wrong primary key type
data.mainKeyErrorColumns ["brand@quantity"] List List of rows of the wrong primary key type
data.typeErrorLineNum 1 Integer Number of rows with typed errors in other columns
data.typeErrorColumns ["iswin@num"] List Other columns contain a list of rows with type errors
data.repeatWithConlumnName - List Display name and attribute name duplicate list
data.repeatWithConlumnName.columnName channel@channel_name String Attribute field name
data.repeatWithConlumnName.columnDesc Channel Type String Property display name
data.repeatWithConlumnDesc - List Duplicate list of display names and display names
data.repeatWithConlumnDesc.columnName channel@channel_name String Attribute field name
data.repeatWithConlumnDesc.columnDesc Channel Type String Property display name

Error Response Example

{
    "return_code": -3004,
    "return_message": "invalid item"
}
Parameter name Sample value Parameter type Parameter description
return_code -3004 String Return code
return_message Invalid item String Return information

# New Virtual Attributes

note

Update the virtual property definition if the virtual property with the same name already exists.

Interface URL

/open/create-sql-prop?token=xxx&projectId=110

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
projectId 110 Integer Yes Project ID

Request Body Parameter

{
  "sqlExpression": "get_ip_location(\"#ip\")",
  "vProp" : {
    "property" : {
      "columnDesc": "Geographic Location Information for IP Address Resolution",
      "columnName": "#vp@location_array_from_ip",
      "tableType": "event",
      "selectType":"array"
    }
  },
  "sqlEventRelationType" : "relation_default",
}
$$Parameter name Sample value Parameter type Is required Parameter description
sqlExpression get_ip_location(\"#ip\") String Yes SQL expression
vProp - Object Yes Virtual attribute information
vProp.property - Object Yes Virtual attribute information
vProp.property.columnDesc Geolocation Information for Internet Protocol Address Resolution String No Field name
vProp.property.columnName #vp@location_array_from_ip String Yes Field display name
vProp.property.tableType event String Yes Table type
  • Event: event attributes

  • User: user features

vProp.property.selectType array String Yes Filter value filter box type
sqlEventRelationType relation_default String No Parse type, default relation_default
  • relation_default: Automatically resolve related events

  • relation_always: All events are related events

  • relation_by_setting: Related events in relatedEvents

Successful Response Example

{
    "return_code": 0,
    "return_message": "success"
}
Parameter name Sample value Parameter type Parameter description
return_code 0 String Return code
return_message success String Return information

Error Response Example

{
    "return_code": -3004,
    "return_message": "invalid item"
}
Parameter name Sample value Parameter type Parameter description
return_code -3004 String Return code
return_message Invalid item String Return information

# Delete Dimension Attributes

Interface URL

/open/delete-dict-props?token=xxx&projectId=0&tableType=event&mainColumnName=test

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
projectId 0 Integer Yes Project ID
tableType event String Yes Attribute type
  • Event: event attributes

  • User: user features

mainColumnName test String Yes The name of the main attribute associated with the dimension table

Successful Response Example

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

Error Response Example

{
    "return_code": -1008,
    "return_message": "Event property test has been hidden or deleted, please reset the condition"
}
Parameter name Sample value Parameter type Parameter description
return_code -1008 Integer Return code
return_message Event property test has been hidden or deleted, please reset conditions String Return information

# Delete SQL Virtual Attribute

Interface URL

/open/delete-sql-prop-by-name?token=xxx&projectId=0&tableType=event&propName=test

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
projectId 0 Integer Yes Project ID
tableType event String Yes Attribute type
  • Event: event

  • User: user

propName test String Yes Attribute name

Successful Response Example

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

Error Response Example

{
    "return_code": -1023,
    "return_message": "virtual event prop test does not exist"
}
Parameter name Sample value Parameter type Parameter description
return_code -1023 Integer Return code
return_message Virtual event prop test does not exist String Return information