参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Authorization | String | 是 | HMAC-SHA256 Credential=BDPP2952f97532xxxxxx/20240716/cn/openPlatform/request, SignedHeaders=host;x-content-sha256;x-date, Signature=131f3d297eb22a7xxxxxx | 详细介绍请查阅调用方式文档 |
X-Tenant | String | 是 | 1 | 项目ID |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
ApiAction | String | 是 | genExportSqlSeg | 固定值,对应“请求说明”中的“接口名称” |
ApiVersion | String | 是 | 2024-05-22 | 固定值,版本号: 2024-05-22 |
analysisModuleObjId | Int | 是 | 1 | 指标id |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
name | String | 否 | 分群1 | 人群包名称 |
desc | String | 否 | 分群1 | 人群包描述 |
isHidden | Bool | 否 | false | 是否隐藏 |
sourceModel | String | 否 | segment | 来源模块 |
sourcePlatform | String | 否 | cdp | 来源平台 |
taskConf | TaskConf | 否 | {} | 任务配置 |
condition | SegmentationConditionSegmentationSQLExtraCondition | 否 | {} | 条件 |
groupIds | Array | 否 | [1] | 授权分组 |
grantSubjects | Array | 否 | [{}] | 授权对象 |
idType | Int | 否 | 1 | 实体ID |
period | BasePeriod | 是 | {} | 时间条件 |
segFilter | JsonNode | 是 | {} | 人群要素 |
authUser | String | 否 | admin | 行权限用户,可以不传入 |
baseDimension | BaseDimension | 否 | {} | 基础维度 |
hashMethod | String | 否 | MD5 | 哈希方法 |
TaskConf
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
skipCheck | Boolean | 否 | true | 是否跳过检查 |
notAutoRun | Boolean | 否 | false | 是否自动执行 |
scheduleTime | String | 否 | 10:00 | 调度时间 |
scheduleType | String | 否 | Daily | 调度类型:Once、Daily、Trigger、Realtime |
SegmentationConditionSegmentationSQLExtraCondition
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
majorIdValues | Array | 否 | [1,2] | 组合id主id筛选项 |
extraCondition | SegmentationSQLExtraCondition | 否 | {} | 分群sql |
targetIdTypeId | Number | 否 | 1 | 目标id类型 |
encryptionMethod | String | 否 | MD5 | 加密方式 |
onlineServiceEnabled | Boolean | 否 | false | 是否开启在线服务 |
SegmentationSQLExtraCondition
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
sql | String | 是 | select xx from xx | 分群sql |
type | String | 否 | "" | 类型 |
idKey | String | 是 | id | id键 |
BasePeriod
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
num | Int | 1 | 时间单位量 |
name | String | 天 | 事件单位名称 |
type | String | RANGE | 类型: |
offset | Int | 2 | 日期偏移 |
endTime | String | 2020-01-01 10:00:00 | 结束时间 |
baseTime | String | 2020-01-01 00:00:00 | 基准时间 |
startTime | String | 2020-01-01 08:00:00 | 开始时间 |
periodRange | Sring | DAY | 时间单位: |
BaseDimension
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
num | Int | 1 | 时间单位量 |
name | String | 天 | 事件单位名称 |
type | String | RANGE | 类型: |
offset | Int | 2 | 日期偏移 |
endTime | String | 2020-01-01 10:00:00 | 结束时间 |
baseTime | String | 2020-01-01 00:00:00 | 基准时间 |
startTime | String | 2020-01-01 08:00:00 | 开始时间 |
periodRange | Sring | DAY | 时间单位: |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
msg | String | 成功 | 接口返回信息 |
code | Number | 0 | 状态码,0表示正常 |
data | Segmentation | 接口返回数据体 | |
traceId | String | 跟踪id |
Segmentation
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
id | Int | 1001990 | 人群id |
desc | String | 描述 | 人群描述 |
name | String | 人群 | 人群名称 |
count | Int | 10012 | 人群数量 |
idType | IdType | {} | 人群id类型 |
taskConf | TaskConf | {} | 任务配置 |
condition | JsonNode | {} | 人群条件 |
createdBy | String | admin | 创建人 |
updatedBy | String | admin | 最近更新人 |
createTime | String | 2024-12-03T23:31:49.000+08:00 | 创建时间 |
updateTime | String | 2024-12-03T23:31:49.000+08:00 | 最近更新时间 |
segType | String | SqlExport | 人群类型 |
sourcePlatform | String | CDP | 来源平台 |
sourceModule | String | segment | 来源模块 |
deletedFlag | Int | 0 | 删除标识 |
isHidden | Bool | false | 是否隐藏(GMP人群可能会隐藏) |
readable | Bool | true | 是否可读 |
childSegments | Array | [] | 子包 |
IdType
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
id | Int | 1 | ID类型唯一标识 |
code | String | baseid | ID类型code |
name | String | 基准ID | ID类型名称 |
dataType | String | Decimal | 数据类型:String, Decimal, Composite |
entityType | String | BaseId | 实体类型:BaseId, Phone, Phone_SHA256, IDFA, IDFA_MD5, IMEI, IMEI_MD5, OAID, OAID_MD5, DeviceID, PrivateID, ByteId, DY_MpID_OpenID, DY_MpID_OpenID_MD5, WX_UnionID, WX_AppID_OpenID, DouDian_AppID_OpenID, WX_External_UserID, WX_Group_ChatID |
needEncrypt | Bool | false | 是否需要加密 |
subjectId | Int | 1 | 主体id |
subjectName | String | xxx | 主体名称 |
orgId | Int | 1 | 集团ID |
subjectType | String | Person | 主体类型 |
availableMappingIds | Array | [] | 可用的idmapping策略 |
TaskConfig
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
skipCheck | Boolean | false | 跳过检查 |
notAutoRun | Boolean | false | 是否自动执行 |
scheduleTime | String | 2020-01-02 10:00:00 | 调度时间 |
scheduleType | String | Once | 调度类型:Once |
GET /?ApiAction=genExportSqlSeg&ApiVersion=2024-05-22&analysisModuleObjId=1
{ "code": 0, "msg": "success", "data": { "id": 1001990, "desc": null, "name": "openapi2024-12-03T15:31:48.373", "count": null, "idType": { "id": 1, "subjectId": 1, "code": "baseid", "name": "主体1的基准ID", "dataType": null, "entityType": "BaseId", "needEncrypt": null, "referFinderId": null, "baseId": true }, "taskConf": { "skipCheck": null, "notAutoRun": null, "scheduleType": "Trigger", "scheduleTime": "00:00" }, "condition": { "targetIdTypeId": 1, "majorIdValues": null, "encryptionMethod": null, "onlineServiceEnabled": false, "extraCondition": { "type": "SqlExport", "sql": "xxx", "showConf": null }, "realtimeEnabled": null, "sampleLimit": null, "kvKeyFormat": null }, "createdBy": "admin", "updatedBy": "admin", "createTime": "2024-12-03T23:31:49.000+08:00", "updateTime": "2024-12-03T23:31:49.000+08:00", "segType": "SqlExport", "sourcePlatform": "CDP", "sourceModule": null, "deletedFlag": 0, "isHidden": false, "readable": true, "childSegments": null } }
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
HTTP 状态码 | 错误码 | 错误信息 | 说明 |
---|---|---|---|
400 | invalidParameter | PARAMETER INVALID | 参数非法,检查入参。 |