批量物料下载模块
更新时间:2019-06-19
下载返回对象
下载返回对象是请求getFilePath接口的返回参数类型,描述具体的返回的文件URL和md5值。
字段名称 | 类型 | 描述 |
---|---|---|
feedAccountFilePath | string | 账户属性文件下载路径 |
feedAccountFileMd5 | string | 账户属性文件md5 |
feedCampaignFilePath | string | 计划文件下载路径 |
feedCampaignFileMd5 | string | 计划文件md5 |
feedAdgroupFilePath | string | 单元文件下载路径 |
feedAdgroupFileMd5 | string | 单元文件md5 |
feedCreativeFilePath | string | 创意文件下载路径 |
feedCreativeFileMd5 | string | 创意文件md5 |
返回文件有效列名
层级 | 用户输入 | 对应列 | 说明 |
---|---|---|---|
accountFeed | userId | userId | 账户ID |
- | balance | balance | 推广余额 |
- | budget | budget | 账户预算 |
- | balancePackage | balancePackage | 资金包 |
- | userStat | userStat | 账户状态 |
- | validFlows | validFlows | 流量禁推属性 |
campaignFeed | campaignFeedId | campaignFeedId | 推广计划ID |
- | campaignFeedName | campaignFeedName | 推广计划名称 |
- | budget | budget | 推广计划预算 |
- | subject | subject | 推广对象 |
- | appinfo | appinfo | APP信息 |
- | budget | budget | 推广计划预算 |
- | starttime | starttime | 推广开始时间 |
- | endtime | endtime | 推广结束时间 |
- | schedule | schedule | 推广暂停时段 |
- | bgtctltype | bgtctltype | 预算分配控制 |
- | pause | pause | 暂停/启用推广计划 |
- | status | status | 推广计划状态 |
- | adgroupFeedId | adgroupFeedId | 推广单元ID |
adgroupFeed | campaignFeedId | campaignFeedId | 推广计划ID |
- | adgroupFeedName | adgroupFeedName | 推广单元名称 |
- | ftypes | ftypes | 复选流量 |
- | pause | pause | 暂停启用推广单元 |
- | status | status | 推广单元状态 |
- | bid | bid | 出价 |
- | age | age | 年龄 |
- | sex | sex | 性别 |
- | education | education | 学历 |
- | interests | interests | 长期兴趣 |
- | directories | directories | 贴吧主题 |
- | region | region | 地域(省市) |
- | device | device | 平台 |
- | net | net | 网络 |
- | keywords | keywords | 意图词 |
- | producttype | producttype | 版位 |
- | producttypes | producttypes | 复选版位 |
- | app | app | APP行为 |
- | bizArea | bizArea | 商圈(选择) |
- | customArea | customArea | 商圈(自定义) |
- | place | place | 场所 |
- | excludeCrowd | excludeCrowd | 排除人群 |
- | articleType | articleType | 文章分类 |
- | intentTag | intentTag | 意图标签 |
- | intentIntension | intentIntension | 意图标签覆盖范围 |
- | keywordsExtend | keywordsExtend | 意图词类型设置 |
creativeFeed | creativeFeedId | creativeFeedId | 创意ID |
- | adgroupFeedId | adgroupFeedId | 推广单元ID |
- | materialstyle | materialstyle | 样式 |
- | pause | pause | 暂停启用创意 |
- | material | material | 物料内容 |
- | status | status | 创意状态 |
发起批量下载
接口描述
- 获取指定账户下的完整数据(计划、单元、关键词、创意)。
- 获取指定计划下的完整数据(计划、单元、关键词、创意)。
- 定制需要返回的层级文件,以及各层级文件中的数据列。
接口URL
http://sem.baidubce.com/v1/feed/cloud/BulkJobFeedService/getAllFeedObjects
请求参数说明
字段名称 | 类型 | 描述 | 限制 |
---|---|---|---|
campaignIds | array(number) | 指定计划id,获取其下全部物料信息。如为空,则获取该账户下的完整物料信息 | 选填,默认为空; 为空表示获取该账户下的完整物料信息 |
format | number | 压缩文件格式 | 选填,默认为1; 0:zip 1:Gzip |
feedAccountFields | array(string) | 帐户层级需要返回的数据列 | 选填,不填不返回文件; 填"all"获取该层级所有字段; 有效列名请参见有效列 |
feedCampaignFields | array(string) | 计划层级需要返回的数据列 | 选填,不填不返回文件; 填"all"获取该层级所有字段; 有效列名请参见有效列 |
feedAdgroupFields | array(string) | 单元层级需要返回的数据列 | 选填,不填不返回文件; 填"all"获取该层级所有字段; 有效列名请参见有效列 |
feedCreativeFields | array(string) | 创意层级需要返回的数据列 | 选填,不填不返回文件; 填"all"获取该层级所有字段; 有效列名请参见有效列 |
响应参数说明
字段名称 | 类型 | 描述 |
---|---|---|
fileId | string | 下载任务id |
请求示例
POST /v1/feed/cloud/BulkJobFeedService/getAllFeedObjects HTTP/1.1
Accept-encoding: 'gzip, deflate'
Host: sem.baidubce.com
ContentType: application/json
Authorization: bce-auth-v1/b406c344bb764e00aff7d3b80d9bd87a/2019-06-05T07:34:31Z/1800/host/bb0f820e4499b8b44548388b37a7afed970e965a7a59f79ebac47a99c315a97b(签名有效时间为30分钟,需要替换成自己生成的签名)
Accept: '*/*'
{
"header": {
"opUsername": "example",
"tgUsername": "example",
"bceUser": "example",
"opPassword": "example",
"tgPassword": "example"
},
"body": {
"campaignIds": [],
"format": 0,
"feedAccountFields": ["all"],
"feedCampaignFields": ["all"],
"feedAdgroupFields": ["all"],
"feedCreativeFields": ["all"]
}
}
响应示例
{
"body": {
"data": [
{
"fileId": "ba1f2511fc30423bdbb183fe33f3dd0f"
}
]
},
"header": {
"oprs": 1,
"failures": [],
"succ": 1,
"oprtime": 0,
"desc": "success",
"status": 0
}
}
获取任务状态
接口描述
在调用getAllFeedObejects接口后使用,以查询请求的文件是否已生成。
接口URL
http://sem.baidubce.com/v1/feed/cloud/BulkJobFeedService/getFileStatus
请求参数说明
字段名称 | 类型 | 描述 | 限制 |
---|---|---|---|
fileId | string | 下载任务id | 必填 |
响应参数说明
字段名称 | 类型 | 描述 |
---|---|---|
isGenerated | number | 1:等待中 2:处理中 3:处理成功 5:处理成功,部分文件下载失败 对于生成失败的文件返回null和对应的错误码 |
请求示例
POST /v1/feed/cloud/BulkJobFeedService/getFileStatus HTTP/1.1
Accept-encoding: 'gzip, deflate'
Host: sem.baidubce.com
ContentType: application/json
Authorization: bce-auth-v1/b406c344bb764e00aff7d3b80d9bd87a/2019-06-05T07:34:31Z/1800/host/bb0f820e4499b8b44548388b37a7afed970e965a7a59f79ebac47a99c315a97b(签名有效时间为30分钟,需要替换成自己生成的签名)
Accept: '*/*'
{
"header": {
"opUsername": "example",
"tgUsername": "example",
"bceUser": "example",
"opPassword": "example",
"tgPassword": "example"
},
"body": {
"fileId": "ba1f2511fc30423bdbb183fe33f3dd0f"
}
}
响应示例
{
"body": {
"data": [
{
"isGenerated": 3
}
]
},
"header": {
"oprs": 1,
"failures": [],
"succ": 1,
"oprtime": 0,
"desc": "success",
"status": 0
}
}
获取文件路径
接口描述
在调用getFileStatus接口后使用,如果返回isGenerated=3或5(任务完成),获取该任务生成的文件URL
接口URL
http://sem.baidubce.com/v1/feed/cloud/BulkJobFeedService/getFilePath
请求参数说明
字段名称 | 类型 | 描述 | 限制 |
---|---|---|---|
fileId | string | 下载任务id | 必填 |
响应参数说明
响应内容为下载返回对象,请参考其定义。
请求示例
POST /v1/feed/cloud/BulkJobFeedService/getFilePath HTTP/1.1
Accept-encoding: 'gzip, deflate'
Host: sem.baidubce.com
ContentType: application/json
Authorization: bce-auth-v1/b406c344bb764e00aff7d3b80d9bd87a/2019-06-05T07:34:31Z/1800/host/bb0f820e4499b8b44548388b37a7afed970e965a7a59f79ebac47a99c315a97b(签名有效时间为30分钟,需要替换成自己生成的签名)
Accept: '*/*'
{
"header": {
"opUsername": "example",
"tgUsername": "example",
"bceUser": "example",
"opPassword": "example",
"tgPassword": "example"
},
"body": {
"fileId": "ba1f2511fc30423bdbb183fe33f3dd0f"
}
}
响应示例
{
"body": {
"data": [
{
"accountFeedFilePath": "https://apidata.baidu.com/***",
"accountFeedFileMd5": "b026324c6904b2a9cb4b88d6d61c8***",
"campaignFeedFilePath": "https://apidata.baidu.com/***",
"campaignFeedFileMd5": "26ab0db90d72e28ad0ba1e22ee510***",
"adgroupFeedFilePath": "https://apidata.baidu.com/***",
"adgroupFeedFileMd5": "6d7fce9fee471194aa8b5b6e47267***",
"creativeFeedFilePath": "https://apidata.baidu.com/***",
"creativeFeedFileMd5": "48a24b70a0b376535542b996af517***"
}
]
},
"header": {
"oprs": 1,
"failures": [],
"succ": 1,
"oprtime": 0,
"desc": "success",
"status": 0
}
}