# 用户分群和标签 API
调用方法请参见Open API文档中的调用方法描述。
# 添加条件分群或标签
接口URL
/open/user-cluster-add?token=xxx
请求方式
POST
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
下面分不同情况展示请求body示例
**1.**添加条件分群
请求Body参数
{
  "projectId": 102,
  "clusterName": "recent_7_days_consume",
  "clusterCatalog": "catalog_cluster",
  "clusterType": "cluster_by_static_condition",
  "displayName": "recent_7_days_consume",
  "qp": {
    "events": [
      {
        "comparator": "greater",
        "eventName": "consume_item",
        "num": "4",
        "recentDay": "1-7",
        "taPropQuota": {
          "analysis": "TIMES"
        }
      }
    ],
    "event_relation": "and",
    "filts": [
      {
        "columnName": "user_level",
        "comparator": "equal",
        "ftv": [
          "3"
        ],
        "tableType": "user"
      }
    ],
    "relation": "and",
    "event_user_relation": "and"
  }
}
参数名  |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| projectId |  102 |  String |  是 |  项目ID | 
| clusterName |  recent_7_days_consume |  String |  是 |  分群名称(只能为字符数字且长度不能超过24) | 
| clusterCatalog |  catalog_cluster |  String |  否 |  分群类型 catalog_cluster:分群 catalog_tag:标签  | 
| clusterType |  cluster_by_static_condition |  String |  否 |  分群类型 cluster_by_dynamic_condition:动态条件更新用户群 cluster_by_static_condition:静态条件用户群 cluster_by_result:结果分群 cluster_by_import:自定义上传 ID 分群 cluster_by_dynamic_sql:动态SQL分群 cluster_by_static_sql:静态SQL分群 tag_by_dynamic_condition:动态条件更新用户标签 tag_by_static_condition:静态条件用户标签 tag_by_import:自定义上传 ID 标签 tag_by_dynamic_sql:动态SQL标签 tag_by_static_sql:静态SQL标签  | 
| displayName |  recent_7_days_consume |  String |  是 |  分群显示名称(最长不能超过50字符) | 
| qp |  - |  Object |  否 |  分群定义 | 
| ∟ events | - |  List |  否 |  参与事件条件列表 | 
| ∟ comparator | greater |  String |  是 |  参见模型查询API的 筛选表达式 中的操作符说明 | 
| ∟ eventName | consume_item |  String |  是 |  事件名称 | 
| ∟ num | 4 |  String |  否 |  筛选值 | 
| ∟ recentDay | 1-7 |  String |  否 |  相对时间 | 
| ∟ taPropQuota | - |  Object |  是 |  事件指标 | 
| ∟ analysis | TIMES |  String |  否 |  分析角度 见 事件分析模型API 中的聚合方法analysis取值列表 | 
| ∟ event_relation | and |  String |  否 |  参与事件条件之间的逻辑关系(and,or) | 
| ∟ filts | - |  List |  否 |  用户属性条件列表 | 
| ∟ columnName | user_level |  String |  是 |  字段名称 | 
| ∟ comparator | equal |  String |  参见模型查询API的 筛选表达式 中的操作符说明 | |
| ∟ ftv | ["3"] |  List |  否 |  筛选值列表 | 
| ∟ tableType | user |  String |  是 |  event:事件属性,user:用户属性 | 
| ∟ relation | and |  String |  否 |  用户属性条件之间的逻辑关系 | 
| ∟ event_user_relation | and |  String |  否 |  参与事件条件列表与用户属性条件列表之间的逻辑关系 | 
添加条件标签
subConditionTabType 字段说明:
| 字段 |  描述 | 
|---|---|
| tag_condition_default |  自定义条件标签 | 
| tag_condition_by_firstlast_event |  首末次特征标签 | 
tagQp 字段包含了标签定义,不同类型标签使用不同的字段:
| 字段 |  描述 | 
|---|---|
| userTagValueDefs |  自定义条件标签 | 
| userTagConFirstLastEventDef |  首末次特征标签 | 
2.自定义条件标签
userTagValueDefs 字段说明:
| 字段 |  描述 | 
|---|---|
| tagValue |  标签值 | 
| userClusterDef |  标签值匹配定义,字段定义见 UserClusterDef | 
- Request body (application/json)
 
{
  "projectId": 102,
  "clusterName": "tag_20200615_1",
  "clusterCatalog": "catalog_tag",
  "clusterType": "tag_by_static_condition",
  "subConditionTabType" : "tag_condition_default",
  "displayName": "标签_20200615_1",
  "tagQp": {
    "userTagValueDefs": [
      {
        "tagRemark": "",
        "tagValue": "标签值1",
        "userClusterDef": {
          "event_relation": "and",
          "event_user_relation": "and",
          "events": [
            {
              "eventName": "player_register",
              "num": "4",
              "recentDay": "1-30",
              "relation": "and",
              "taPropQuota": {
                "analysis": "TIMES"
              },
              "comparator": "greater"
            }
          ],
          "filts": [],
          "relation": "and"
        }
      },
      {
        "tagRemark": "",
        "tagValue": "标签值2",
        "userClusterDef": {
          "event_relation": "and",
          "event_user_relation": "and",
          "events": [
            {
              "eventName": "fight_success",
              "num": "0",
              "recentDay": "1-30",
              "relation": "and",
              "taPropQuota": {
                "analysis": "TIMES"
              }
              "uceCalcuSymbol": "greater"
            }
          ],
          "filts": [],
          "relation": "and"
        }
      }
    ]
  }
}
3.首末次特征标签
- Request body (application/json)
 
{
  "projectId": 2,
  "clusterName": "tag_test_20200615_1",
  "clusterCatalog": "catalog_tag",
  "clusterType": "tag_by_static_condition",
  "subConditionTabType": "tag_condition_by_firstlast_event",
  "displayName": "标签_test",
  "tagQp": {
    "userTagConFirstLastEventDef": {
      "userTagConFirstLastEvent": {
        "calcPropVo": {
          "isCalc": false,
          "property": {
            "columnName": "#vp@test_num",
            "tableType": "event"
          }
        },
        "eventName": "pay",
        "isFirstEvent": true,
        "recentDay": "0-1",
        "filts": [
          {
            "columnName": "#os",
            "comparator": "equal",
            "ftv": [
              "android"
            ],
            "tableType": "event"
          }
        ],
        "relation": "and"
      }
    }
  }
}
4.指标值标签 (从版本 3.2.1 开始支持)
- Request body (application/json)
 
{
  "projectId": 2,
  "clusterName": "tag_test_20200615_1",
  "clusterCatalog": "catalog_tag",
  "clusterType": "tag_by_static_condition",
  "subConditionTabType": "tag_condition_by_quotation",
  "displayName": "标签_test",
  "tagQp": {
    "userTagConQuotaDef": {
      "userTagConQuotaEvent": {
        "type": "normal",
        "quota": "activity_reward",
        "analysis": "DISTINCT",
        "eventName": "activity_attend",
        "recentDay": "0-1",
        "filts": [
          {
            "columnName": "#os",
            "comparator": "equal",
            "ftv": [
              "android"
            ],
            "tableType": "event"
          }
        ],
        "relation": "and"
      }
    }
  }
}
成功响应示例
{
    "data": 970,
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| data |  970 |  Object |  成功数量 | 
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
# 分群或标签详情查询
通过 clusterId 或者 clusterName 查询详情
接口URL
/open/user-cluster-detail?token=xxx&projectId=102&clusterId=970
/open/user-cluster-detail?token=xxx&projectId=102&clusterName=recent_7_days_consume
请求方式
GET
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| projectId |  102 |  Integer |  是 |  项目ID | 
| clusterId |  970 |  integer |  否 |  分群ID | 
| clusterName |  recent_7_days_consume |  String |  否 |  分群名称 | 
成功响应示例
{
  "data": {
    "clusterName": "recent_7_days_consume",
    "clusterType": "cluster_by_static_condition",
    "displayName": "recent_7_days_consume",
    "id": 970,
    "progress": 1,
    "projectId": 102,
    "refreshTime": "2020-01-10 10:51:14",
    "userClusterDef": {
      "event_relation": "and",
      "event_user_relation": "and",
      "events": [
        {
          "comparator": "greater",
          "endTime": "2020-01-09 00:00:00",
          "eventName": "consume_item",
          "num": "4",
          "recentDay": "1-7",
          "startTime": "2020-01-03 00:00:00",
          "taPropQuota": {
            "analysis": "TIMES"
          }
        }
      ],
      "filts": [
        {
          "columnName": "user_level",
          "comparator": "equal",
          "ftv": [
            "3"
          ],
          "tableType": "user"
        }
      ],
      "relation": "and"
    },
    "userId": 13,
    "usersNum": 0
  },
  "return_code": 0,
  "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
| data |  - |  Object |  返回结果 | 
| ∟ clusterName | recent_7_days_consume |  String |  分群名称 | 
| ∟ clusterType | cluster_by_static_condition |  String |  分群类型 cluster_by_dynamic_condition:动态条件更新用户群 cluster_by_static_condition:静态条件用户群 cluster_by_result:结果分群 cluster_by_import:自定义上传 ID 分群 cluster_by_dynamic_sql:动态SQL分群 cluster_by_static_sql:静态SQL分群 tag_by_dynamic_condition:动态条件更新用户标签 tag_by_static_condition:静态条件用户标签 tag_by_import:自定义上传 ID 标签 tag_by_dynamic_sql:动态SQL标签 tag_by_static_sql:静态SQL标签  | 
| ∟ displayName | recent_7_days_consume |  String |  分群显示名称 | 
| ∟ id | 970 |  Integer |  分区ID | 
| ∟ progress | 1 |  Integer |  任务执行进度,100表示执行成功,0-99表示当前计算进度,-1表示执行失败 | 
| ∟ projectId | 102 |  Integer |  所属项目ID | 
| ∟ refreshTime | 2020-01-10 10:51:14 |  String |  分群刷新时间 | 
| ∟ userId | 13 |  Integer |  分群所属userId | 
| ∟ usersNum | 0 |  Integer |  分群用户数 | 
| ∟ userClusterDef | - |  Object |  条件分群定义 | 
| ∟ event_relation | and |  String |  做过事件的属性列表的筛选条件逻辑关系 | 
| ∟ event_user_relation | and |  String |  做过事件与用户属性之间的筛选条件逻辑关系 | 
| ∟ events | - |  List |  做过事情条件列表 | 
| ∟ comparator | greater |  String |  参见模型查询API的 筛选表达式 中的操作符说明 | 
| ∟ endTime | 2020-01-09 00:00:00 |  String |  开始时间 | 
| ∟ eventName | consume_item |  String |  事件名称 | 
| ∟ num | 4 |  String |  |
| ∟ recentDay | 1-7 |  String |  相对时间 | 
| ∟ startTime | 2020-01-03 00:00:00 |  String |  结束时间 | 
| ∟ taPropQuota | - |  Object |  事件指标 | 
| ∟ analysis | TIMES |  String |  分析角度 见 事件分析模型API 中的聚合方法analysis取值列表 | 
| ∟ filts | - |  List |  用户属性条件列表 | 
| ∟ columnName | String |  user_level |  字段名称 | 
| ∟ comparator | String |  equal |  参见模型查询API的筛选表达式中的操作符说明 | 
| ∟ ftv | List |  ["3"] |  筛选值列表 | 
| ∟ tableType | user |  String |  event:事件属性,user:用户属性 | 
| ∟ relation | and |  String |  用户属性列表的筛选条件逻辑关系 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
| 结果字段 |  描述 | 
|---|---|
| userClusterDef |  分群定义,同qp | 
| userTagDef |  标签定义, 同tagQp | 
# 更新条件分群或标签定义
接口URL
/open/user-cluster-update?token=xxx&clusterId=970
请求方式
POST
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| clusterId |  970 |  integer |  否 |  分群ID | 
请求Body参数
{
  "clusterCatalog": "catalog_cluster",
  "clusterType": "cluster_by_static_condition",
  "displayName": "recent_7_days_consume",
  "projectId": 102,
  "qp": {
    "event_relation": "and",
    "event_user_relation": "and",
    "events": [
      {
        "comparator": "greater",
        "endTime": "2020-01-09 00:00:00",
        "eventName": "consume_item",
        "num": "4",
        "recentDay": "1-7",
        "startTime": "2020-01-03 00:00:00",
        "taPropQuota": {
          "analysis": "TIMES"
        }
      }
    ],
    "filts": [
      {
        "columnName": "user_level",
        "comparator": "equal",
        "ftv": [
          "3"
        ],
        "tableType": "user"
      }
    ],
    "relation": "and"
  }
}
参数说明同接口 添加条件分群或标签
成功响应示例
{
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
# 根据名称更新条件分群或标签定义
接口URL
/open/user-cluster-update-by-name?token=xxx&projectId=xxx&clusterName= recent_7_days_consume
请求方式
POST
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| clusterId |  970 |  integer |  否 |  分群ID | 
请求Body参数
{
  "clusterCatalog": "catalog_cluster",
  "clusterType": "cluster_by_static_condition",
  "displayName": "recent_7_days_consume",
  "projectId": 102,
  "qp": {
    "event_relation": "and",
    "event_user_relation": "and",
    "events": [
      {
        "comparator": "greater",
        "endTime": "2020-01-09 00:00:00",
        "eventName": "consume_item",
        "num": "4",
        "recentDay": "1-7",
        "startTime": "2020-01-03 00:00:00",
        "taPropQuota": {
          "analysis": "TIMES"
        }
      }
    ],
    "filts": [
      {
        "columnName": "user_level",
        "comparator": "equal",
        "ftv": [
          "3"
        ],
        "tableType": "user"
      }
    ],
    "relation": "and"
  }
}
参数说明同接口 添加条件分群或标签
成功响应示例
{
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
# 删除分群或标签
接口URL
/open/user-cluster-delete?token=xxx&projectId=102&clusterId=970
请求方式
POST
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| projectId |  102 |  Integer |  是 |  项目ID | 
| clusterId |  970 |  Integer |  是 |  分群ID | 
成功响应示例
{
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
# 根据名称删除分群或标签
接口URL
/open/delete-user-cluster-by-name?token=xxx&projectId=102&clusterName= recent_7_days_consume
请求方式
POST
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| projectId |  102 |  Integer |  是 |  项目ID | 
| clusterName |  recent_7_days_consume |  Integer |  是 |  分群名称 | 
成功响应示例
{
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
# 分群和标签列表查询
接口URL
/open/user-cluster-list?token=xxx
请求方式
POST
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
请求Body参数
{
  "clusterCatalog": "catalog_cluster",
  "clusterName": "test001",
  "clusterTypes": [
    "cluster_by_dynamic_condition",
    "cluster_by_static_condition"
  ],
  "pagerHeader": {
    "pageNum": 1,
    "pageSize": 10
  },
  "projectId": 102
}
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| clusterCatalog |  catalog_cluster |  String |  是 |  分群类型 | 
| clusterName |  test001 |  String |  否 |  分群/标签名称模糊搜索 | 
| clusterTypes |  ["cluster_by_dynamic_condition"] |  List |  是 |  集群类型 | 
| pagerHeader |  - |  Object |  否 |  分页信息 | 
| ∟ pageNum | 1 |  Integer |  否 |  第几页 | 
| ∟ pageSize | 10 |  Integer |  否 |  页大小 | 
| projectId |  102 |  Integer |  是 |  项目ID | 
成功响应示例
{
    "data": {
        "pagerResult": {
            "pageNum": 1,
            "pageSize": 10,
            "totalNum": 2
        },
        "userClusters": [
            {
                "clusterCatalog": "catalog_cluster",
                "clusterName": "xuzz_ces",
                "clusterType": "cluster_by_static_condition",
                "displayName": "用户数",
                "historyDataStatus": 0,
                "id": 905,
                "mainColumnName": "",
                "progress": 100,
                "projectId": 102,
                "refreshDelay": 0,
                "refreshTime": "2019-11-01 15:08:31",
                "remarks": "2134",
                "selectType": "string",
                "status": 1,
                "uploadFileName": "",
                "userId": 108,
                "userName": "自动化测试__sync",
                "usersNum": 4665
            },
            {
                "clusterCatalog": "catalog_cluster",
                "clusterName": "test",
                "clusterType": "cluster_by_static_condition",
                "displayName": "test",
                "historyDataStatus": 0,
                "id": 183,
                "mainColumnName": "",
                "progress": 100,
                "projectId": 102,
                "refreshDelay": 0,
                "refreshTime": "2019-11-01 15:05:28",
                "remarks": "test",
                "selectType": "string",
                "status": 1,
                "uploadFileName": "",
                "userId": 108,
                "userName": "自动化测试__sync",
                "usersNum": 5603
            }
        ]
    },
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
| data |  - |  Object |  返回结果 | 
| ∟ pagerResult | - |  Object |  分页结果 | 
| ∟ pageNum | 1 |  Integer |  当前页 | 
| ∟ pageSize | 10 |  Integer |  每页条目 | 
| ∟ totalNum | 2 |  Integer |  总条数 | 
| ∟ userClusters | - |  Object |  分群列表 | 
| ∟ clusterCatalog | catalog_cluster |  String |  分群类型 catalog_cluster:分群 catalog_tag:标签  | 
| ∟ clusterName | xuzz_ces |  String |  分群名称 | 
| ∟ clusterType | cluster_by_static_condition |  String |  分群类型 cluster_by_dynamic_condition:动态条件更新用户群 cluster_by_static_condition:静态条件用户群 cluster_by_result:结果分群 cluster_by_import:自定义上传 ID 分群 cluster_by_dynamic_sql:动态SQL分群 cluster_by_static_sql:静态SQL分群 tag_by_dynamic_condition:动态条件更新用户标签 tag_by_static_condition:静态条件用户标签 tag_by_import:自定义上传 ID 标签 tag_by_dynamic_sql:动态SQL标签 tag_by_static_sql:静态SQL标签  | 
| ∟ displayName | 用户数 |  String |  分群显示名称 | 
| ∟ historyDataStatus | 0 |  Integer |  是否有历史版本数据 | 
| ∟ id | 905 |  Integer |  分区ID | 
| ∟ mainColumnName | String |  ID分群关联属性 | |
| ∟ progress | 100 |  Integer |  任务执行进度,100表示执行成功,0-99表示当前计算进度,-1表示执行失败 | 
| ∟ projectId | 102 |  Integer |  所属项目ID | 
| ∟ refreshDelay | 0 |  Long |  分群刷新延时 | 
| ∟ refreshTime | 2019-11-01 15:08:31 |  String |  分群刷新时间 | 
| ∟ remarks | 2134 |  String |  分群备注 | 
| ∟ selectType | string |  String |  标签类型 | 
| ∟ status | 1 |  Integer |  分群状态,0:无效,1:有效 | 
| ∟ uploadFileName | String |  上传文件名 | |
| ∟ userId | 108 |  Integer |  分群所属userId | 
| ∟ userName | 自动化测试__sync |  String |  分群所属userName | 
| ∟ usersNum | 4665 |  Integer |  分群用户数 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
# 刷新条件分群或标签
接口URL
/open/user-cluster-refresh?token=xxx&projectId=102&clusterId=970
/open/user-cluster-refresh-by-name?token=xxx&projectId=102&clusterName=recent_7_days_consume
请求方式
POST
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| projectId |  102 |  Integer |  是 |  项目ID | 
| clusterId |  970 |  integer |  否 |  分群ID | 
| clusterName |  recent_7_days_consume |  String |  否 |  分群名称 | 
成功响应示例
{
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
# 查询刷新进度
提交刷新后,可查询刷新进度
/open/user-cluster-refresh-progress?token=xxx&projectId=102&clusterId=970
/open/user-cluster-refresh-progress-by-name?token=xxx&projectId=102&clusterName=recent_7_days_consume
请求方式
GET
Content-Type
application/json
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| projectId |  102 |  Integer |  是 |  项目ID | 
| clusterId |  970 |  integer |  否 |  分群ID | 
| clusterName |  recent_7_days_consume |  String |  否 |  分群名称 | 
成功响应示例
{
  "data": {
    "progress": 80,
  },
  "return_code": 0,
  "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| data |  - |  Object |  返回结果 | 
| ∟ progress | 100 |  Integer |  取值范围[0, 100], 100 代表刷新完成 | 
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
# 创建上传ID分群或标签
接口URL
/open/import-id-cluster-add?token=xxx&projectId=102&displayName=xxxx&mainColumnName=#account_id
请求方式
POST
Content-Type
text/csv
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| projectId |  102 |  Integer |  是 |  项目ID | 
| displayName |  xxx |  String |  是 |  分群显示名(最长 50 个字符) | 
| mainColumnName |  #account_id |  String |  是 |  分群关联属性 | 
| clusterCatalog |  String |  否 |  分群类别: catalog_cluster, catalog_tag。默认为catalog_cluster | |
| clusterName |  String |  否 |  分群名称(最长 24 个字符) ,字母数字构成,不填则由系统生成 | |
| remarks |  String |  否 |  分群备注 | 
成功响应示例
{
    "data": {
        "clusterId": 1889,
        "tagValueNullNum": 0,
        "unmatchedNum": 0,
        "uploadNum": 5,
        "userNum": 5
    },
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
| data |  Object |  返回结果 | |
| ∟ clusterId | 1889 |  Integer |  用户分群ID | 
| ∟ tagValueNullNum | 0 |  Integer |  Tag值为null的行数 | 
| ∟ unmatchedNum | 0 |  Integer |  未匹配记录数 | 
| ∟ uploadNum | 5 |  Integer |  上传记录数 | 
| ∟ userNum | 5 |  Integer |  用户群人数 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
curl 示例(trace.txt 删除 Send/Recv 描述行)
[root@ta1 ~]# curl --trace-ascii trace.txt --header 'Content-Type: text/csv' --data-binary '@test.csv' 'http://ta2:8992/open/import-id-cluster-add?token=bTOzKiTIozG4e19FgXphcA8dDV3DIY8RwdHTO7aSnBsRqSNaIk19BnBMecJDWibD&projectId=102&displayName=xxxx&mainColumnName=%23account_id'
{"data":{"clusterId":1889,"tagValueNullNum":0,"unmatchedNum":0,"uploadNum":5,"userNum":5},"return_code":0,"return_message":"success"}
[root@ta1 ~]#
[root@ta1 ~]#
[root@ta1 ~]# cat trace.txt
== Info: About to connect() to ta2 port 8992 (#0)
== Info:   Trying 10.81.129.35...
== Info: Connected to ta2 (10.81.129.35) port 8992 (#0)
0000: POST /open/import-id-cluster-add?token=bTOzKiTIozG4e19FgXphcA8dD
0040: V3DIY8RwdHTO7aSnBsRqSNaIk19BnBMecJDWibD&projectId=102&displayNam
0080: e=xxxx&mainColumnName=%23account_id HTTP/1.1
00ae: User-Agent: curl/7.29.0
00c7: Host: ta2:8992
00d7: Accept: */*
00e4: Content-Type: text/csv
00fc: Content-Length: 43
0110:
0000: j77639
0008: h84497
0010: g119426
0019: e154284
0022: f175355
== Info: upload completely sent off: 43 out of 43 bytes
0000: HTTP/1.1 200 OK
0000: Date: Thu, 05 Nov 2020 04:06:31 GMT
0000: Content-Type: application/json;charset=utf-8
0000: Content-Length: 148
0000:
0000: {"data":{"clusterId":1889,"tagValueNullNum":0,"unmatchedNum":0,"
0040: uploadNum":5,"userNum":5},"return_code":0,"return_message":"succ
0080: ess"}
== Info: Connection #0 to host ta2 left intact
# 修改上传ID分群或标签
接口URL
/open/import-id-cluster-modify?token=xxx&projectId=102&clusterId=970&displayName=xxx&remarks=xxx&mainColumnName=xxx
请求方式
POST
Content-Type
text/csv
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| projectId |  102 |  Integer |  是 |  项目ID | 
| clusterId |  Integer |  是 |  分群ID | |
| clusterName |  String |  是 |  分群名 | |
| displayName |  String |  否 |  分群显示名(最长 50 个字符) | |
| mainColumnName |  String |  否 |  分群关联属性 | |
| remarks |  String |  否 |  分群备注 | 
成功响应示例
{
    "data": "",
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
| data |  Object |  返回结果 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
curl 示例(trace.txt 删除 Send/Recv 描述行)
[root@ta1 ~]# curl --trace-ascii trace.txt --header 'Content-Type: text/csv' --data-binary '@test.csv' 'http://ta2:8992/open/import-id-cluster-modify?token=bTOzKiTIozG4e19FgXphcA8dDV3DIY8RwdHTO7aSnBsRqSNaIk19BnBMecJDWibD&projectId=102&clusterId=1889&displayName=xxxx&mainColumnName=%23account_id'
{"data":{"clusterId":1889,"tagValueNullNum":0,"unmatchedNum":0,"uploadNum":5,"userNum":5},"return_code":0,"return_message":"success"}
[root@ta1 ~]#
[root@ta1 ~]#
[root@ta1 ~]# cat trace.txt
== Info: About to connect() to ta2 port 8992 (#0)
== Info:   Trying 10.81.129.35...
== Info: Connected to ta2 (10.81.129.35) port 8992 (#0)
0000: POST /open/import-id-cluster-modify?token=bTOzKiTIozG4e19FgXphcA
0040: 8dDV3DIY8RwdHTO7aSnBsRqSNaIk19BnBMecJDWibD&projectId=102&cluster
0080: Id=1889&displayName=xxxx&mainColumnName=%23account_id HTTP/1.1
00c0: User-Agent: curl/7.29.0
00d9: Host: ta2:8992
00e9: Accept: */*
00f6: Content-Type: text/csv
010e: Content-Length: 43
0122:
0000: j77639
0008: h84497
0010: g119426
0019: e154284
0022: f175355
== Info: upload completely sent off: 43 out of 43 bytes
0000: HTTP/1.1 200 OK
0000: Date: Thu, 05 Nov 2020 04:12:58 GMT
0000: Content-Type: application/json;charset=utf-8
0000: Content-Length: 148
0000:
0000: {"data":{"clusterId":1889,"tagValueNullNum":0,"unmatchedNum":0,"
0040: uploadNum":5,"userNum":5},"return_code":0,"return_message":"succ
0080: ess"}
== Info: Connection #0 to host ta2 left intact
# 根据名称修改上传ID分群或标签
接口URL
/open/import-id-cluster-modify-by-name?token=xxx&projectId=102&clusterName= recent_7_days_consume&displayName=xxxx&remarks=xxx&mainColumnName=xxx
请求方式
POST
Content-Type
text/csv
请求Query参数
| 参数名 |  示例值 |  参数类型 |  是否必填 |  参数描述 | 
|---|---|---|---|---|
| token |  xxx |  String |  是 |  token | 
| projectId |  102 |  Integer |  是 |  项目ID | 
| clusterName |  recent_7_days_consume |  String |  是 |  分群名 | 
| displayName |  String |  否 |  分群显示名(最长 50 个字符) | |
| mainColumnName |  String |  否 |  分群关联属性 | |
| remarks |  String |  否 |  分群备注 | 
成功响应示例
{
    "data": "",
    "return_code": 0,
    "return_message": "success"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  0 |  Integer |  返回码 | 
| return_message |  success |  String |  返回信息 | 
| data |  Object |  返回结果 | 
错误响应示例
{
    "return_code": -1008,
    "return_message": "参数(token)为空"
}
| 参数名 |  示例值 |  参数类型 |  参数描述 | 
|---|---|---|---|
| return_code |  -1008 |  Integer |  返回码 | 
| return_message |  参数(token)为空 |  String |  返回信息 | 
← 数据自定义查询 API 维度表 API →
