You need to enable JavaScript to run this app.
导航
V2.0
最近更新时间:2024.04.30 15:17:28首次发布时间:2024.04.30 15:17:28

1. 概述

本文档提供火山引擎增长分析中新版用户标签 OpenAPI 的使用说明(私有化>=4.5版本面向新客开放)。如您的环境仍使用的是旧版标签,请参考V1.0版本OpenAPI
旧版标签示例:
图片
图片
新版标签示例:
图片
图片

2. API 公共参数

Headers

名称

数据类型

是否必选

描述

X-Tenant

Int

项目id

项目ID的获取方法

可在portal管理中心--项目管理--项目列表中查看项目ID
图片
Response:

{
        "code": 0,
        "data": xxx,
        "message": "success"
}
  • code 状态码,0 表示成功,其他失败
  • message 成功或失败信息
  • data 结果数据,具体结构参考具体的 API 描述

3.上传文件 API

3.1 API 定义

Path:/finder/openApi/v2/atlas/labelMeta/uploadLabelData
Method: POST
Content-type: multipart/form-data;
Header

名称

数据类型

是否必选

描述

X-Tenant

Int

项目id

Body:

{
    "file": {二进制文件}
}

Response:

{
  "JSONIFY_PRETTYPRINT_REGULAR": false, 
  "code": 0, 
  "data": {
    "dataModelId": 376
  }, 
  "msg": "成功"
}

使用multipart/form-data来进行上传文件,文件的field name固定为“file”,文件格式仅支持csv,文件大小限制为 100M,仅支持单个文件:

  • 第一行为表头:id,标签值,即用户id,用户对应的标签值
  • 从第二行开始是具体的数据
  • 如果是list的类型的话,多个value值以空格分隔

样例:

id,标签值
a123456,value_a
b123456,value_b
c123456,value_c value_c1

返回结果字段含义说明:
data 返回的是一个 JSON object, 针对关键字段进行说明

Field

Type

Description

dataModelId

int

上传文件对应id

3.2 OpenAPI SDK 使用样例

bc 为创建的 RangersClient, 其初始化请参考 “OpenAPI SDK 使用说明”, 各语言的 SDK 都提供了类似的接口
调用(Python):

files = {  # form-data 格式文件
    'file': ('user_tag.csv', open('user_tag.csv', 'rb'))  # key 必须为 'file',value 为上传的 csv 文件
}
res = bc.request(method='POST', service_url='/finder/openApi/v2/atlas/labelMeta/uploadLabelData', headers={'x-Tenant': "1"}, files=files)
print(res.content)
print(json.loads(res.content))

返回结果:

{
  "JSONIFY_PRETTYPRINT_REGULAR": false, 
  "code": 0, 
  "data": {
    "dataModelId": 376
  }, 
  "msg": "成功"
}

4. 根据上传文件创建人工标签 API

4.1 API 定义

Path:/finder/openApi/v2/atlas/labelMeta/manualLabel
Method: POST
Content-type: application/json
Header:

名称

数据类型

是否必选

描述

X-Tenant

Int

项目id

Body:

名称

数据类型

是否必选

描述

name

String

标签名称

labelEntityType

String

标签实体类型

appId

Int

项目id

descr

String

标签描述

dataTypeName

String

标签数据类型

conf

Json

标签配置,如果需要上传文件可以配置其中的manualProperty,dataModelId为上传文件****API返回id

labelRangeRules

Json

人工标签枚举值规则
文本&多值文本类型规则:

"labelRangeRules": {
        "value": {
            "enumValue": ["男", "女"]
        }
    }

数值类型规则:

"labelRangeRules": {
        "value": {
            "minValue": 1,
            "maxValue": 5
        }
    }

Body样例:

{
    "name": "manual22",
    "labelEntityType": "baseid",
    "conf": {
        "manualProperty": {
            "dataModelId": 374
        }
    },
    "appId": 1,
    "descr": "",
    "dataTypeName": "string",
    "labelRangeRules": {
        "value": {
            "enumValue": ["男", "女"]
        }
    }
}

Response:

{
  "JSONIFY_PRETTYPRINT_REGULAR": false, 
  "code": 0, 
  "data": {
    "labelId": 42
  }, 
  "msg": "成功"
}

字段含义说明

Field

Type

Description

code

int

状态码

message

string

返回message

labelId

int

创建成功的标签id

4.2 OpenAPI SDK 样例

bc 为创建的 RangersClient, 其初始化请参考 “OpenAPI SDK 使用说明”, 各语言的 SDK 都提供了类似的接口
调用(Python):

body = {
    "name": "manual22",
    "labelEntityType": "baseid",
    "conf": {
        "manualProperty": {
            "dataModelId": 373
        }
    },
    "appId": 1,
    "descr": "",
    "dataTypeName": "string",
    "labelRangeRules": {
        "value": {
            "enumValue": ["男", "女"]
        }
    }
}
res = bc.request(method='POST', service_url='/finder/openApi/v2/atlas/labelMeta/manualLabel', headers={'x-Tenant': "1", "Content-Type": "application/json"}, body=body)
print(res.content)
print(json.loads(res.content))

返回结果:

{
    "JSONIFY_PRETTYPRINT_REGULAR":false,
    "code":0,
    "data":{
        "labelId":3
    },
    "msg":"成功"
}

5. 查询标签最新结果 API

5.1 API 定义

Path:/finder/openApi/v2/cdpMeta/labelSystem/label/latestHistoryData
Method: GET
Path-parameters:

名称

数据类型

是否必选

描述

id

Int

标签id

showNum

Int

标签值数量(取值范围大于0)

Header:

名称

数据类型

是否必选

描述

X-Tenant

Int

项目id

Response:

{
    "code":0,
    "msg":"成功",
    "data":{
        "scheduleTime":"2023-04-25",
        "distinctNumber":5124,
        "coverage":"100.00%",
        "statistics":[
            {
                "count":5124,
                "originValue":"标签值1",
                "mappingValue":"标签值1",
                "tagCoverage":"100.00%",
                "totalCoverage":"100.00%"
            }
        ],
        "queryMauCost":16,
        "queryDataCost":160
    }
}

字段含义说明
data 返回的是一个 JSON object, 针对关键字段进行说明

Field

Type

Description

scheduleTime

string

最新结果的计算日期(建议使用)

distinctNumber

int

数据总行数

coverage

double

属于该标签值的数据行数在数据总行数的占比

statistics

object

计算结果详情

statistics.originValue

string

标签值

statistics.mappingValue

string

标签映射值

statistics.count

int

属于该标签值的数据行数

statistics.tagCoverage

string

属于该标签值的标签覆盖率

statistics.totalCoverage

string

属于该标签值的总人数覆盖率

queryMauCost

int

查询mautag消耗时间

queryDataCost

int

查询标签数据消耗时间

5.2 OpenAPI SDK 样例

bc 为创建的 RangersClient, 其初始化请参考 “OpenAPI SDK 使用说明”, 各语言的 SDK 都提供了类似的接口
调用(Python)::

res = bc.request('/finder/openApi/v2/cdpMeta/labelSystem/label/latestHistoryData', headers={'x-Tenant': "1"}, params={'id': 2, 'showNum': 10})
print(res.content)
print(json.loads(res.content))

返回结果:

{
    "code":0,
    "msg":"成功",
    "data":{
        "scheduleTime":"2023-06-25",
        "distinctNumber":873,
        "coverage":"2.28%",
        "statistics":[
            {
                "count":873,
                "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                "tagCoverage":"100.00%",
                "totalCoverage":"2.28%"
            }
        ],
        "queryMauCost":42,
        "queryDataCost":279
    }
}

6. 查询标签历史计算结果 API

6.1 API 定义

Path:/finder/openApi/v2/cdpMeta/labelSystem/label/historyData
Method: GET
Content-type: application/json
Path-parameters:

名称

数据类型

是否必选

描述

id

Int

标签id

showNum

Int

标签值数量

startDate

String

开始日期(格式yyyy-MM-dd)

endDate

String

结束日期(格式yyyy-MM-dd)

Header:

名称

数据类型

是否必选

描述

X-Tenant

Int

项目id

Response:

{
    "code":0,
    "msg":"成功",
    "data":[
        {
            "scheduleTime":"2023-04-20",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"标签值1",
                    "mappingValue":"标签值1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":15,
            "queryDataCost":148
        },
        {
            "scheduleTime":"2023-04-21",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"标签值1",
                    "mappingValue":"标签值1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":15,
            "queryDataCost":148
        },
        {
            "scheduleTime":"2023-04-22",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"标签值1",
                    "mappingValue":"标签值1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":15,
            "queryDataCost":148
        },
        {
            "scheduleTime":"2023-04-23",
            "distinctNumber":5124,
            "coverage":"100.00%",
            "statistics":[
                {
                    "count":5124,
                    "originValue":"标签值1",
                    "mappingValue":"标签值1",
                    "tagCoverage":"100.00%",
                    "totalCoverage":"100.00%"
                }
            ],
            "queryMauCost":15,
            "queryDataCost":148
        }
    ]
}

字段含义说明
data 返回的是一个 JSON object, 针对关键字段进行说明:同查询标签最新结果API

6.2 OpenAPI SDK 样例

bc 为创建的 RangersClient, 其初始化请参考 “OpenAPI SDK 使用说明”, 各语言的 SDK 都提供了类似的接口
调用(Python):

res = bc.request('/finder/openApi/v2/cdpMeta/labelSystem/label/historyData', headers={'x-Tenant': "1"}, params={'startDate': '2023-06-01', 'endDate': '2023-06-16', 'id': 2, 'showNum': 10})
print(res.content)
print(json.loads(res.content))

返回结果:

{
    "code":0,
    "msg":"成功",
    "data":[
        {
            "scheduleTime":"2023-06-01",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-02",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-03",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-04",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-05",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-06",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-07",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-08",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-09",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-10",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-11",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-12",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-13",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-14",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-15",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        },
        {
            "scheduleTime":"2023-06-16",
            "distinctNumber":0,
            "coverage":"0.00%",
            "statistics":[
                {
                    "count":0,
                    "originValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "mappingValue":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1",
                    "tagCoverage":"NA",
                    "totalCoverage":"0.00%"
                }
            ],
            "queryMauCost":70,
            "queryDataCost":531
        }
    ]
}

7. 查询标签基本信息 API

7.1 API 定义

Path:/profile_platform/openApi/v2/cdpMeta/labelSystem/label/metaInfo
Method: GET
Path-parameters:

名称

数据类型

是否必选

描述

id

Int

标签id

Header:

名称

数据类型

是否必选

描述

X-Tenant

Int

项目id

Response:

{
    "code": 0,
    "msg": "",
    "data": {
            "id":4,
            "name":"autotest_quanliang03181231",
            "orgId":1,
            "projectId":1,
            "descr":"",
            "dataSecurityLevel":null,
            "labelType":"rule",
            "dataTypeName":"string",
            "domainId":-2,
            "position":3,
            "entityId":1,
            "entityType":"baseid",
            "computeType":"offline",
            "isMautag":0,
            "syncParams":{
                "scheduleConf":{
                    "frequency":"d",
                    "scheduleTime":"02:00:00"
                },
                "syncType":1
            },
            "conf":{
                "layers":[
                    {
                        "filter":{
                            "operator":"And",
                            "filters":[
                                {
                                    "operator":"And",
                                    "filters":[
                                        {
                                            "operator":"=",
                                            "tagId":3,
                                            "value":0
                                        }
                                    ]
                                }
                            ]
                        },
                        "name":"标签值1"
                    }
                ]
            },
            "taskId":100000018,
            "dimMetId":282,
            "labelRangeRules":null,
            "status":0,
            "createApiTask":false,
            "realtimeTaskId":null,
            "realtimeStatus":null,
            "owner":"admin",
            "createTime":"2023-03-18 12:42:47",
            "updater":"admin",
            "updateTime":"2023-03-18 12:42:50",
            "abiDimMetId":0,
            "lastSuccessTaskInstanceId":1192,
            "latestRunDate":"2023-04-25",
            "userNum":5124,
            "values":null
        }
}

字段含义说明
data 返回的是一个 JSON object, 针对关键字段进行说明

Field

Type

Description

id

int

标签id

name

string

标签名称

orgId

int

集团id

projectId

int

项目id

descr

string

标签描述

dataTypeName

string

值类型(枚举类型): int、string、float、datetime

status

string

状态

labelType

string

创建类型

conf

object

创建规则

syncParams

object

调度配置

taskId

int

任务id

owner

string

创建人

createTime

int

创建时间时间戳

updateTime

int

更新时间时间戳

7.2 OpenAPI SDK 样例

bc 为创建的 RangersClient, 其初始化请参考 “OpenAPI SDK 使用说明”, 各语言的 SDK 都提供了类似的接口
调用(Python)::

res = bc.request('/finder/openApi/v2/cdpMeta/labelSystem/label/metainfo/2', headers={'x-Tenant': "1"})
print(res.content)
print(json.loads(res.content))

返回结果:

{
    "code":0,
    "msg":"成功",
    "data":{
        "id":2,
        "name":"\xe6\xb3\xa8\xe5\x86\x8c",
        "orgId":1,
        "projectId":1,
        "descr":"",
        "dataSecurityLevel":null,
        "labelType":"rule",
        "dataTypeName":"string",
        "domainId":-2,
        "position":1,
        "entityId":1,
        "entityType":"baseid",
        "computeType":"offline",
        "isMautag":0,
        "syncParams":{
            "scheduleConf":{
                "frequency":"d",
                "scheduleTime":"00:00:00"
            },
            "syncType":1
        },
        "conf":{
            "layers":[
                {
                    "filter":{
                        "operator":"And",
                        "filters":[
                            {
                                "operator":"And",
                                "filters":[
                                    {
                                        "eventId":25,
                                        "eventDatasourceId":19,
                                        "eventType":0,
                                        "period":{
                                            "last":1,
                                            "todayIncluded":false,
                                            "interval":"Day",
                                            "type":"Last"
                                        },
                                        "eventName":"register",
                                        "operator":"Done",
                                        "aggregate":{
                                            "method":"Count",
                                            "condition":{
                                                "operator":"!=",
                                                "value":0
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    "name":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1"
                }
            ]
        },
        "taskId":2,
        "dimMetId":334,
        "labelRangeRules":null,
        "status":0,
        "createApiTask":false,
        "realtimeTaskId":null,
        "realtimeStatus":null,
        "owner":"admin",
        "createTime":"2023-06-25 19:26:14",
        "updater":"admin",
        "updateTime":"2023-06-25 19:26:16",
        "abiDimMetId":0,
        "lastSuccessTaskInstanceId":1061,
        "latestRunDate":"2023-06-26",
        "userNum":3570,
        "realtimeCompensateTaskId":null,
        "values":null
    }
}

8. 查询应用下所有标签 API

8.1 API 定义

Path:/profile_platform/openApi/v2/cdpMeta/labelSystem/label/list
Method: GET
Path-parameters:

名称

数据类型

是否必选

描述

subjectId

Int

主体id

Header:

名称

数据类型

是否必选

描述

X-Tenant

Int

项目id

Response:

{
    "code":0,
    "msg":"成功",
    "data":[
        {
            "id":4,
            "name":"autotest_quanliang03181231",
            "orgId":1,
            "projectId":1,
            "descr":"",
            "dataSecurityLevel":null,
            "labelType":"rule",
            "dataTypeName":"string",
            "domainId":-2,
            "position":3,
            "entityId":1,
            "entityType":"baseid",
            "computeType":"offline",
            "isMautag":0,
            "syncParams":{
                "scheduleConf":{
                    "frequency":"d",
                    "scheduleTime":"02:00:00"
                },
                "syncType":1
            },
            "conf":{
                "layers":[
                    {
                        "filter":{
                            "operator":"And",
                            "filters":[
                                {
                                    "operator":"And",
                                    "filters":[
                                        {
                                            "operator":"=",
                                            "tagId":3,
                                            "value":0
                                        }
                                    ]
                                }
                            ]
                        },
                        "name":"标签值1"
                    }
                ]
            },
            "taskId":100000018,
            "dimMetId":282,
            "labelRangeRules":null,
            "status":0,
            "createApiTask":false,
            "realtimeTaskId":null,
            "realtimeStatus":null,
            "owner":"admin",
            "createTime":"2023-03-18 12:42:47",
            "updater":"admin",
            "updateTime":"2023-03-18 12:42:50",
            "abiDimMetId":0,
            "lastSuccessTaskInstanceId":1192,
            "latestRunDate":"2023-04-25",
            "userNum":5124,
            "values":null
        }
    ]
}

字段含义说明
data 返回的是一个 JSON array, 针对关键字段进行说明:同查询标签基本信息API

8.2 OpenAPI SDK 样例

bc 为创建的 RangersClient, 其初始化请参考 “OpenAPI SDK 使用说明”, 各语言的 SDK 都提供了类似的接口
调用(Python)::

res = bc.request('/finder/openApi/v2/cdpMeta/labelSystem/label/list', headers={'x-Tenant': "1"})
print(res.content)
print(json.loads(res.content))

返回结果:

{
    "code":0,
    "msg":"成功",
    "data":[
        {
            "id":2,
            "name":"\xe6\xb3\xa8\xe5\x86\x8c",
            "orgId":1,
            "projectId":1,
            "descr":"",
            "dataSecurityLevel":null,
            "labelType":"rule",
            "dataTypeName":"string",
            "domainId":-2,
            "position":1,
            "entityId":1,
            "entityType":"baseid",
            "computeType":"offline",
            "isMautag":0,
            "syncParams":{
                "scheduleConf":{
                    "frequency":"d",
                    "scheduleTime":"00:00:00"
                },
                "syncType":1
            },
            "conf":{
                "layers":[
                    {
                        "filter":{
                            "operator":"And",
                            "filters":[
                                {
                                    "operator":"And",
                                    "filters":[
                                        {
                                            "eventId":25,
                                            "eventDatasourceId":19,
                                            "eventType":0,
                                            "period":{
                                                "last":1,
                                                "todayIncluded":false,
                                                "interval":"Day",
                                                "type":"Last"
                                            },
                                            "eventName":"register",
                                            "operator":"Done",
                                            "aggregate":{
                                                "method":"Count",
                                                "condition":{
                                                    "operator":"!=",
                                                    "value":0
                                                }
                                            }
                                        }
                                    ]
                                }
                            ]
                        },
                        "name":"\xe6\xa0\x87\xe7\xad\xbe\xe5\x80\xbc1"
                    }
                ]
            },
            "taskId":2,
            "dimMetId":334,
            "labelRangeRules":null,
            "status":0,
            "createApiTask":false,
            "realtimeTaskId":null,
            "realtimeStatus":null,
            "owner":"admin",
            "createTime":"2023-06-25 19:26:14",
            "updater":"admin",
            "updateTime":"2023-06-25 19:26:16",
            "abiDimMetId":0,
            "lastSuccessTaskInstanceId":1058,
            "latestRunDate":"2023-06-25",
            "userNum":874,
            "realtimeCompensateTaskId":null,
            "values":null
        }
    ]
}

9. 触发标签计算 API

9.1 API 定义

Path:/finder/openApi/v2/cdpMeta/labelSystem/label/rerun
Method: POST
Path-parameters:
Header:

名称

数据类型

是否必选

描述

X-Tenant

Int

项目id

Body

名称

数据类型

是否必选

描述

labelId

Int

标签id

startDate

String

开始日期(格式yyyy-MM-dd)

endDate

String

结束日期(格式yyyy-MM-dd)

Response:

{"code":0,"msg":"成功","data":null}

字段含义说明

Field

Type

Description

code

int

状态码

message

string

返回message

data

null

无返回数据

9.2 OpenAPI SDK 样例

bc 为创建的 RangersClient, 其初始化请参考 “OpenAPI SDK 使用说明”, 各语言的 SDK 都提供了类似的接口
调用(Python)::

res = bc.request(method='POST', service_url='/finder/openApi/v2/cdpMeta/labelSystem/label/rerun', headers={"Content-Type": "application/json", 'x-Tenant': "1"}, body={'startDate': '2023-06-16', 'endDate': '2023-06-16', 'labelId': 2})
print(res.content)
print(json.loads(res.content))

返回结果:

{"code":0,"msg":"成功","data":null}