Metadata management API
For how to call the API, see the calling method described in the Open API document.
We recommend that you first read the metadata management section of the AE user guide to learn about the related features: Data management - events and properties
1. Event management
1. Query a custom event
Endpoint URL
/open/get-virtual-event-by-name?token=xxx&projectId=377&eventName=ta@test222
Request method
GET
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 377 | Integer | Yes | Project ID |
| eventName | ta@test222 | String | Yes | Event name |
Success response example
{
"data": {
"eventDesc": "Test custom event",
"eventName": "ta@teset",
"remark": "",
"rule": {
"events": [
{
"eventDesc": "Obtain coins",
"eventName": "obtain_coin",
"filter": {
"filterType": "COMPOUND",
"filts": [],
"relation": "and"
}
}
],
"filter": {
"filterType": "COMPOUND",
"filts": [],
"relation": "and"
}
}
},
"return_code": 0,
"return_message": "success"
}
| $$Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| data | - | Object | Returned data |
| data.eventDesc | Test custom event | String | Event display name |
| data.eventName | ta@teset | String | Event name |
| data.remark | - | String | Event remarks |
| data.rule | - | Object | Custom event rule |
| data.rule.events | - | List | Event list |
| data.rule.events.eventDesc | Obtain coins | String | Event display name |
| data.rule.events.eventName | obtain_coin | String | Event name |
| data.rule.events.filter | - | Object | Property filter |
| data.rule.events.filter.filterType | COMPOUND | String | Filter:
|
| data.rule.events.filter filts | [] | List | List of filter values |
| data.rule.events.filter relation | and | String | Logical relationship of the filter |
| data.rule.filter | - | Object | Property filter |
| data.rule.filter.filterType | COMPOUND | String | Filter:
|
| data.rule.filter.filts | [] | List | List of filter values |
| data.rule.filter.relation | and | String | Logical relationship of the filter |
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
2. Event metadata list
Endpoint URL
/open/list-event-meta?token=xxx&projectId=377
Request method
GET
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 377 | Integer | Yes | Project ID |
propName | - | String | No | Property name. Use this parameter to query the events related to the property. If it isn't passed, all physical events and custom events are returned |
Success response example
{
"data": {
"events": [
{
"eventDesc": "Join activity",
"eventName": "activity_attend",
"eventType": "event",
"isHide": false,
"remark": "Join activity 321"
}
]
},
"return_code": 0,
"return_message": "success"
}
| $$Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| data | - | Object | Returned data |
| data.events | - | List | Event list |
| data.events.eventDesc | Join activity | String | Event description |
| data.events.eventName | activity_attend | String | Event name |
| data.events.eventType | event | String | Event type
|
| data.events.isHide | false | Boolean | Whether hidden |
| data.events.remark | Join activity 321 | String | Event remarks |
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
3. Create a custom event
Endpoint URL
/open/create-virtual-event?token=xxx&projectId=0&override=false
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
| override | false | String | Yes | If a custom event with the same name already exists, an error is returned when override=false, and the custom event definition is updated when override=true. |
Request body parameters
{
"eventName": "ta@test_vevent",
"eventDesc": "Test custom event",
"remark": "",
"rule": {
"events": [
{
"eventDesc": "Join activity",
"eventName": "activity_attend",
"filter": {
"relation": "and",
"filts": [
{
"comparator": "equal",
"columnDesc": "Network type",
"columnName": "network",
"ftv": [
"4G"
],
"selectType": "string",
"tableType": "event"
}
]
}
}
]
}
}
| $$Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| eventName | ta@test_vevent | String | Yes | Event name |
| eventDesc | Test custom event | String | No | Event display name |
| remark | String | No | Event remarks | |
| rule | - | Object | Yes | Rule |
| rule.events | - | List | Yes | Event list |
| rule.events.eventName | activity_attend | String | Yes | Event name |
| rule.events.eventDesc | Join activity | String | No | Event display name |
| rule.events.filter | - | Object | No | Property filter |
| rule.events.filter.filterType | SIMPLE | String | No | Filter
|
| rule.events.filter.filts | - | List | No | List of filter objects |
| rule.events.filter.filts.comparator | equal | String | No | Comparison type |
| rule.events.filter.filts.columnDesc | Network Type | String | No | Field display name |
| rule.events.filter.filts.columnName | network | String | Yes | Field name |
| rule.events.filter.filts.ftv | ["4G"] | List | No | List of filter values |
| rule.events.filter.filts.selectType | string | String | No | Filter value input type |
| rule.events.filter.filts.tableType | event | String | No | event: event property, user: user property |
| rule.events.filter.filts.filterType | SIMPLE | String | No | Filter:
|
| rule.events.filter.relation | and | String | No | Logical relationship of the filter |
Success response example
{
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1008,
"return_message": "eventName cannot be empty, rule cannot be null"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1008 | Integer | Return code |
| return_message | eventName cannot be empty, rule cannot be null | String | Return message |
4. Modify the event display name and remarks
- The event display name can be up to 60 characters. Any excess is truncated automatically
- The event display name can't contain emojis
- The display name of a custom event can't be the same as the display name or event name of another custom event
- The display name of a physical event can't be the same as the display name or event name of another physical event
Endpoint URL
/open/update-event-info?token=xxx&projectId=0
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
Request body parameters
{
"eventName": "test007",
"eventDesc": "testDesc",
"eventRemark": "testRemark"
}
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| eventName | test | String | Yes | Event name |
| eventDesc | testDesc | String | Yes | Event display name |
| eventRemark | testRemark | String | No | Event remarks |
Success response example
{
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1008,
"return_message": "Event test007 has been hidden or deleted. Reset the conditions"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1008 | Integer | Return code |
| return_message | Event test007 has been hidden or deleted. Reset the conditions | String | Return message |
5. Delete a custom event
Endpoint URL
/open/delete-virtual-event-by-name?token=xxx&projectId=0&eventName=test
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
| eventName | test | String | Yes | Event name |
Success response example
{
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1008,
"return_message": "Event test has been hidden or deleted. Reset the conditions"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1008 | String | Return code |
| return_message | Event test has been hidden or deleted. Reset the conditions | String | Return message |
2. Property management
1. Query a custom property
Endpoint 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 parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
| propName | #vp@location | String | Yes | Property name |
| tableType | event | String | Yes | event: event property, user: user property |
Success response example
{
"data": {
"relatedEvents": [
{
"eventName": "Event name",
"eventDesc": "Event display name"
}
],
"sqlEventRelationType": "relation_default",
"sqlExpression": "concat(\"#country\",'-',\"#province\",'-',\"#city\")",
"vProp": {
"property": {
"columnDesc": "Geolocation information",
"columnName": "#vp@location",
"selectType": "string",
"tableType": "event"
}
}
},
"return_code": 0,
"return_message": "success"
}
| $$Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| data | - | Object | Returned data |
| data.relatedEvents | - | List | Associated event list |
| data.relatedEvents.eventName | Event name | String | Event name |
| data.relatedEvents.eventDesc | Event display name | String | Event display name |
| data.sqlEventRelationType | relation_default | String |
|
| data.sqlExpression | concat("#country",'-',"#province",'-',"#city") | String | SQL expression |
| data.vProp | - | Object | Custom property list |
| data.vProp.property | - | Object | Custom property |
| data.vProp.property.columnDesc | Geolocation information | String | Field display name |
| data.vProp.property.columnName | #vp@location | String | Field name |
| data.vProp.property.selectType | string | String | Filter value input type |
| data.vProp.property.tableType | event | String | Property type
|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1008,
"return_message": "User property test007 has been hidden or deleted. Reset the conditions"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1008 | Integer | Return code |
| return_message | User property test007 has been hidden or deleted. Reset the conditions | String | Return message |
2. Property list
Endpoint URL
/open/list-props?token=xxx&projectId=0&tableType=event&eventName=xxx
Request method
GET
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
| tableType | event | String | Yes | Property type
|
| eventName | - | String | No | Valid when tableType is event. The name of a physical event or custom event. Use this parameter to query the properties related to the event. If it isn't passed, all physical properties and custom properties are returned |
Success response example
{
"data": {
"properties": [
{
"canCreateDict": true,
"columnDesc": "Activity item 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 | Example value | Parameter type | Description |
|---|---|---|---|
| data | - | Object | Returned data |
| data.properties | - | List | |
| data.properties.canCreateDict | true | Boolean | Whether a dimension table can be created |
| 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 fields |
| data.properties.dictProps.canCreateDict | false | String | Whether a dimension table can be created |
| 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 hidden |
| data.properties.dictProps.propType | vprop_dict | String | Property type |
| data.properties.dictProps.selectType | string | String | Filter value input type |
| data.properties.dictProps.tableType | event | String | Table type of the field |
| data.properties.isHide | false | Boolean | Whether hidden |
| data.properties.propType | prop_unpreset | String | Property type
|
| data.properties.selectType | string | String | Filter value input type |
| data.properties.tableType | event | String | Table type of the field |
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
3. Modify the property display name
- The property display name can be up to 60 characters. Any excess is truncated automatically. It can't contain emojis. The display name of a custom property can't be the same as the display name or property name of another custom property, and the display name of a physical property can't be the same as the display name or property name of another physical property
- The property description can be up to 200 characters. Any excess is truncated automatically
- If a custom property with the same name already exists, the custom property definition is updated
Endpoint URL
/open/update-prop-info?token=xxx&projectId=0
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
Request body parameters
{
"columnName": "test",
"columnDesc": "testDesc",
"columnRemark": "testRemark",
"tableType": "event"
}
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| columnName | test | String | Yes | Field name |
| columnDesc | testDesc | String | Yes | Field display name |
| columnRemark | testRemark | String | No | Field description |
| tableType | testType | String | Yes | Property type
|
Success response example
{
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1023,
"return_message": "event property(test) does not exist"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1023 | Integer | Return code |
| return_message | event property(test) does not exist | String | Return message |
4. Validate and create a dimension dictionary
Create a dimension dictionary by uploading a file. The file size limit is 200M
Endpoint URL
/open/dict-create?token=xxx&projectId=0&createParam=test
Request method
POST
Content-Type
text/csv
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
| createParam | test | String | Yes | - |
Success 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 | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | String | Return code |
| return_message | success | String | Return message |
| data | - | Object | Returned data |
| data.totalLineNum | 4 | Integer | Total number of parsed rows |
| data.successLineNum | 1 | Integer | Number of rows imported successfully |
| data.duplcatedMainKeyLineNum | 1 | Integer | Number of rows with duplicate primary keys |
| data.duplcatedMainKeyColumns | ["city@test"] | List | List of rows with duplicate primary keys |
| data.mainKeyErrorLineNum | 1 | Integer | Number of rows with an incorrect primary key type |
| data.mainKeyErrorColumns | ["brand@quantity"] | List | List of rows with an incorrect primary key type |
| data.typeErrorLineNum | 1 | Integer | Number of rows with type errors in other columns |
| data.typeErrorColumns | ["iswin@num"] | List | List of rows with type errors in other columns |
| data.repeatWithConlumnName | - | List | List of display names that duplicate property names |
| data.repeatWithConlumnName.columnName | channel@channel_name | String | Property field name |
| data.repeatWithConlumnName.columnDesc | Channel type | String | Property display name |
| data.repeatWithConlumnDesc | - | List | List of display names that duplicate other display names |
| data.repeatWithConlumnDesc.columnName | channel@channel_name | String | Property field name |
| data.repeatWithConlumnDesc.columnDesc | Channel type | String | Property display name |
Error response example
{
"return_code": -3004,
"return_message": "Invalid project"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -3004 | String | Return code |
| return_message | Invalid project | String | Return message |
5. Create a custom property
If a custom property with the same name already exists, the custom property definition is updated
Endpoint URL
/open/create-sql-prop?token=xxx&projectId=110
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 110 | Integer | Yes | Project ID |
Request body parameters
{
"sqlExpression": "get_ip_location(\"#ip\")",
"vProp" : {
"property" : {
"columnDesc": "Geolocation parsed from the IP address",
"columnName": "#vp@location_array_from_ip",
"tableType": "event",
"selectType":"array"
}
},
"sqlEventRelationType" : "relation_default"
}
| $$Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| sqlExpression | get_ip_location(\"#ip\") | String | Yes | SQL expression |
| vProp | - | Object | Yes | Custom property information |
| vProp.property | - | Object | Yes | Custom property information |
vProp.property.columnDesc | Geolocation parsed from the IP address | 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
|
| vProp.property.selectType | array | String | Yes | Filter value input type |
| sqlEventRelationType | relation_default | String | No | Parsing type. Default: relation_default
|
Success response example
{
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | String | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -3004,
"return_message": "Invalid project"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -3004 | String | Return code |
| return_message | Invalid project | String | Return message |
6. Delete a dimension property
Endpoint URL
/open/delete-dict-props?token=xxx&projectId=0&tableType=event&mainColumnName=test
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
| tableType | event | String | Yes | Property type
|
| mainColumnName | test | String | Yes | Name of the main property that the dimension table is associated with |
Success response example
{
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1008,
"return_message": "Event property test has been hidden or deleted. Reset the conditions"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1008 | Integer | Return code |
| return_message | Event property test has been hidden or deleted. Reset the conditions | String | Return message |
7. Delete a SQL custom property
Endpoint URL
/open/delete-sql-prop-by-name?token=xxx&projectId=0&tableType=event&propName=test
Request method
POST
Content-Type
application/json
Request query parameters
| Parameter name | Example value | Parameter type | Required | Description |
|---|---|---|---|---|
| token | xxx | String | Yes | Query key |
| projectId | 0 | Integer | Yes | Project ID |
| tableType | event | String | Yes | Property type
|
| propName | test | String | Yes | Property name |
Success response example
{
"return_code": 0,
"return_message": "success"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | 0 | Integer | Return code |
| return_message | success | String | Return message |
Error response example
{
"return_code": -1023,
"return_message": "virtual event prop test does not exist"
}
| Parameter name | Example value | Parameter type | Description |
|---|---|---|---|
| return_code | -1023 | Integer | Return code |
| return_message | virtual event prop test does not exist | String | Return message |

