开发者后台管理 API
修订历史
| 发布时间 | 修订说明 |
|---|---|
| 2026-09-18 | 支持 start.io(28)、Google Ad Manager(48)、Verve(53)广告源手工创建(不含自动化)。start.io / Verve 须 Header Bidding(S2S);Google Ad Manager 不支持 Header Bidding。PID 与样式见附录2。 |
| 2026-09-14 | 自定义中介组更新未传 cache_num 时沿用该组已有并行数,不再改成广告类型默认;未传 min_cache 也不再被写成并行数。创建未传 cache_num 仍按类型默认。 |
| 2026-09-11 | 补齐独立绿字段传参:发布地区、中介组超时/频控/开屏重试、组底价与公司级别(二级中级 / 三级高级 / 九级默认)、广告源 group_list 的 selected/rate/is_auto_price。更新只传要改的键,未传保持原值。 |
| 2026-09-11 | 写接口补齐联动校验:上架与安卓市场配对、展示回调类型、填充回调与等待时长、自动刷新开关与时长、最小缓存与并行数、竞价底价仅竞价源可写、创建广告源 is_modify_pid。广告源 group_list 传入须为全量覆盖(含 [] 全关)。更新应用 2/3 可沿用库里的域名和商店链接。 |
| 2026-09-10 | /api/seat/store 回调密钥由系统生成:打开回调只传地址;编辑传 refresh_secret_key / refresh_imp_secret_key=1 换新密钥。查询仍明文回显。 |
| 2026-09-04 | /api/seat/store 支持创建互动广告(ad_type=7)、插播(ad_type=8)。未传 cache_num 时互动广告默认 1、插播默认 2。 |
| 2026-09-02 | 应用/广告位/中介组/广告源写读对齐开发者后台:上架与域名、奖励与展示回调、超时与频控、group_list / 底价 / is_modify_pid。补齐类型校验、group_list 对不上报错不改库、is_modify_pid 冲突说明。 |
| 2026-09-01 | 支持 Digital Turbine、YSO 广告源自动化创建及三方 Placement ID 回写;支持 zMaticoo 广告源手动创建。 |
| 2026-08-31 | 开放 Unity Ads 广告源自动化创建能力(仅非 Bidding),补充 Game ID、Placement ID 回写及 横幅尺寸填写说明。 |
| 2026-08-21 | 穿山甲(adsource_id=17)手动创建须填 placement_config.primeRitId;不支持 OpenAPI 自动化。 |
| 2026-08-21 | AdMob、Moloco 原生横幅 native_ad_size 仅支持 3(300 x 250);历史数据不迁移。 |
| 2026-08-20 | 支持 Moloco、Magnite 广告源手工创建(不含自动化),对齐后台广告类型与 Header Bidding(S2S)。 |
| 2026-08-12 | 重新开放 Yandex 广告源自动化创建能力,补充权限、应用 ID 及激励相关填写说明。 |
| 2026-08-07 | 获取广告位接口(/api/seat/seats)返回新增 adseat_label,用于区分普通、共享、智能策略广告位。 |
| 2026-08-06 | 支持开屏:Unity Ads 插屏开屏。 |
| 2026-07-27 | 支持 Mintegral、Vungle、Bigo、TaurusX、Inmobi 广告源自动化创建能力,覆盖各类广告类型转换适配场景。 |
| 2026-07-24 | 新增中介组排序。 |
| 2026-07-14 | 原生横幅尺寸与关闭按钮配置扩展至 Columbus、TaurusX。 |
| 2026-06-26 | 扩展原生横幅广告源的尺寸与关闭按钮配置说明,新增 Meta、Mintegral、Inmobi、Yandex、Bigo 等平台;Meta 横幅补充原生拼横幅的创建与查询说明。 |
| 2026-06-12 | 支持 AdMob、Google Ad Manager 横幅内嵌式自适应广告源。 |
| 2026-06-11 | 原生横幅广告源支持在 placement_config 中配置 native_ad_size、close_button;适用 AdMob、Pangle、Vungle。 |
| 2026-05-26 | 更新 AdMob 广告源创建说明,统一手动与自动化创建的应用 ID 填写方式。 |
| 2026-05-07 | 支持 Pangle 广告源自动化创建能力,覆盖各类广告类型转换适配场景。 |
| 2026-04-14 | 接口功能 更新:查询广告源信息增加可选参数 ,创建和编辑中介组 支持默认组的更新操作。 |
| 2026-04-09 | 支持 Meta、AdMob 广告源自动化创建能力,覆盖各类广告类型转换适配场景。 |
| 2026-03-25 | 支持 A/B 测试全流程管理能力 |
1 获取 Api Key
在 TradPlus 开发者后台 ,进入“用户信息”,“我的账号”,“API Key”,获取 API Key 和秘钥。
| 名称 | 用途 |
|---|---|
| API Key(bear) | 标识用户身份 |
| 密钥(secret) | 生成请求签名 |
2 API 接入
所有请求都采用post方式,POST 请求数据默认格式为:multipart/form-data;请求域名为:https://openapi.tradplusad.com
2.1 请求公参
| 参数 | 说明 | 传递方式 | 样例 |
|---|---|---|---|
| bear | API key | HTTP Header | 157E4A5D-3877-1236-DE06-457FT3F70C4 |
| sign | 签名 | GET | 5DE008C88087D8556D276A9E5B8E37E6 |
| timestamp | 时间戳,当前时间的秒数 | GET | 1629525680 |
| nonce | 16位长度随机字符,数 字与字母组合 | GET | 5c672d4e9628d0a7 |
2.2 生成签名
获取 bear 和 secret,参考 1 获取 Api Key
具体规则如下:
- 拼接 secret, timestamp, nonce 和请求路径
- md5加密并且转换为大写
$sign = strtoupper(md5($secret+$timestamp+$nonce+$path));
2.3 调用示例
curl --location --request POST 'https://openapi.tradplusad.com/api/seat/store?sign=5DE008C88087D8556D276A9E5B8E37E6×tamp=1629525680&nonce=5c672d4e9628d0a7' \
--header 'bear: 157E4A5D-3877-1236-DE06-457FT3F70C4' \
--form 'adseat_list[0][app_uuid]="BA04D9C5A5E736CCDA8003BC5D936BE5"' \
--form 'adseat_list[0][seat_name]="test创建"' \
--form 'adseat_list[0][ad_type]="5"' \
--form 'adseat_list[0][adseat_uuid]=""'
2.4 返回参数
返回 json 格式
2.4.1 成功
{
"code": 200,
"status": 0,
"data": {
"list": [
{
"adseat_uuid": "8629EE09A4E3C6B60AEC48FA7D6CA4D4",
"seat_name": "test创建",
"error_message": ""
}
]
}
}
2.4.2 失败
{
"code": 403,
"status": -1,
"error_message":"sign error"
}
3 报表
3.1 提交三方广告平台报表数据
请求路径: /api/report/submit
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| report_data_list | Array | Y | 最多10个超过会被丢弃 | |
| report_data_list.day | String | Y | 日期,仅支持到天 Y-m-d 格式 | 示例:2021-02-01 |
| report_data_list.iso | String | Y | 国家二位码(短码) | 示例:GE 见:8.1 |
| report_data_list.adsource_id | Int | Y | tradplus 广告平台 ID | 见:8.2 |
| report_data_list.placement_id | String | Y | 三方广告平台广告位 ID | Mintegral 需要用 "_" 拼接 AD Unit ID Unity_Ads 需要拼接 Game ID Applovin 需要拼接 SDK Key Kidoz 需要拼接应用的包名 package_name ReklamUp 需要拼接应用的包名 package_name 示例:placementID_adUnitID |
| report_data_list.currency | String | N | 币种单位 CNY 或 USD,不传默认 CNY | |
| report_data_list.bidding_request | Int | N | 竞价请求 | 默认 0 |
| report_data_list.bidding_response | Int | N | 竞价响应 | 默认 0 |
| report_data_list.request | Int | N | 请求 | 默认 0 |
| report_data_list.fill | Int | N | 填充 | 默认 0 |
| report_data_list.impression | Int | N | 展示 | 默认 0 |
| report_data_list.click | Int | N | 点击 | 默认 0 |
| report_data_list.income | Float | N | 收入 | 默认 0 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| error | Array | Y | 错误信息列表 |
| error.message | String | N | 错误信息 |
| error.report_data | Array | N | 错误信息详情(同请求数据) |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"error": [
{
"message": "国家二位码(短码) 缺失或者错误",
"report_data": {
"day": "2022-01-18",
"iso": "USA",
"adsource_id": "16",
"placement_id": "abc123",
"currency": "CNY",
"income": "50",
"fill": "800"
}
},
{
"message": "广告网络ID 缺失或者错误",
"report_data": {
"day": "2022-01-19",
"iso": "CN",
"adsource_id": "475",
"placement_id": "22",
"currency": "CNY",
"income": "20",
"fill": "600",
"impression": "100"
}
}
]
}
}
4 应用管理
4.1 获取应用分类
请求路径: /api/app/allcategory
请求参数:无
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| first_category | Array | Y | 一级分类 |
| first_category.id | String | Y | 分类 id |
| first_category.name_cn | String | Y | 中文名 |
| first_category.name_en | String | Y | 英文名 |
| sub_category | Array | Y | 二级分类 |
| sub_category.id | String | Y | 二级分类 id |
| sub_category.pid | String | Y | 对应的一级分类 id |
| sub_category.name_cn | String | Y | 中文名 |
| sub_category.name_en | String | Y | 英文名 |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"first_category": [
{
"id": "1",
"name_cn": "游戏",
"name_en": "Game"
},
{
"id": "2",
"name_cn": "应用",
"name_en": "App"
}
],
"sub_category": [
{
"id": "101",
"name_cn": "动作",
"name_en": "Action",
"pid": "1"
},
{
"id": "102",
"name_cn": "冒险",
"name_en": "Adventure",
"pid": "1"
}
...
]
}
}
4.2 获取应用
请求路径: /api/app/apps
请求参数:
如果传了 app_uuids 则忽略 page,只有在 app_uuids 不传的情况下才返回 has_more 和 total
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| app_uuids | Stirng | N | 应用 ID | 每次最多接受100个 |
| page | Int | N | 页数 默认1 | 每页100条 |
返回字段:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| total | Int | N | 总数 | |
| has_more | Int | N | 是否还有更多 | |
| app_list | Array | Y | 应用信息 | |
| app_list.app_uuid | String | Y | 开发者应用 ID | |
| app_list.app_name | String | Y | 应用名称 | |
| app_list.category_id | Int | Y | 二级分类 | |
| app_list.app_url | String | Y | 应用商店链接 | |
| app_list.package_name | String | Y | 应用包名 | |
| app_list.os | Int | Y | 应用平台 | 1:安卓 2:iOS |
| app_list.is_release | Int | Y | 是否上架 | 1:未上架 2:已上架 3:其他应用市场 |
| app_list.domain | String | Y | 应用域名 | |
| app_list.other_app_market | Int | N | 安卓应用市场 | 仅 Android。取值见附录4 |
| app_list.app_release_region | Int | N | 发布地区 | 1 全球地区、2 中国地区、3 海外地区 |
请求示例
curl --location --request POST 'https://openapi.tradplusad.com/api/app/apps?sign=5DE008C88087D8556D276A9E5B8E37E6×tamp=1629525680&nonce=5c672d4e9628d0a7' \
--header 'bear: 157E4A5D-3877-1236-DE06-457FT3F70C4' \
--header 'Content-Type: application/json' \
--data '{"app_uuids":"348FA2C4CFA91471D09DC529EAB1459E","page":1}'
返回样例:
{
"code": 200,
"status": 0,
"data": {
"has_more": 0,
"total": 25,
"app_list": [
{
"app_uuid": "A741926221D7FEFBCB179D08B4477713",
"app_name": "test1",
"os": 1,
"is_release": 2,
"package_name": "com.test1",
"app_url": "http://www.test1.com",
"category_id": 102,
"domain": "example.com",
"other_app_market": 13,
"app_release_region": 1
},
{
"app_uuid": "4F1E43B002376A505FFFB03F04C170E5",
"app_name": "test2",
"os": 1,
"is_release": 2,
"package_name": "com.test.4iphone",
"app_url": "http://www.test2.com",
"category_id": 111
},
...
]
}
}
4.3 创建和编辑应用
请求路径: /api/app/store
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| app_list | Array | Y | app 信息 | 每次最多10个,超过会被丢弃 |
| app_list.app_uuid | String | N | 开发者应用 ID | 编辑必传 |
| app_list.app_name | String | N | 应用名称 | 编辑必传 |
| app_list.os | Int | N | 应用平台 1:安卓 2:iOS | 创建后不可编辑 |
| app_list.package_name | String | N | 应用包名 | 创建必传 |
| app_list.app_url | String | N | 应用商店链接 | is_release=2 或 3 时须有值:创建必传;更新未传则沿用库里已有链接,显式传空会失败。iOS 已上架或 Android other_app_market=13 时,本次若带了链接会按链接拉取商店信息;app_name、package_name 可覆盖 |
| app_list.category_id | Int | N | 分类参考 3.1 获取应用分类 | 创建必传 |
| app_list.direction | Int | N | 屏幕方向 | 1-竖屏 2-横屏 0-自适应 |
| app_list.is_release | Int | Y | 是否上架 | 创建必填。1 未上架 2 已上架 3 其他应用市场。2/3 时须有 domain 与 app_url:创建必传;更新只改 is_release 时可沿用库里已有值 |
| app_list.domain | String | N | 应用域名 | is_release=2 或 3 时须有值。更新未传则沿用已有域名,显式传空会失败 |
| app_list.other_app_market | Int | N | 安卓应用市场 | 仅 Android。取值见附录4。is_release=2 须为 13;is_release=3 须为 0–12,不能为 13。13 时会按商店链接拉取元数据 |
| app_list.app_release_region | Int | N | 发布地区 | 1 全球地区、2 中国地区、3 海外地区。更新未传则保持原值 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| list | Array | Y | 应用信息 |
| list.app_uuid | Stirng | N | 开发者应用 ID |
| list.app_name | Stirng | N | 应用名称 |
| list.error_message | Stirng | N | 错误信息,空字符表示成功 |
请求示例
curl --location --request POST 'https://openapi.tradplusad.com/api/app/store?sign=5DE008C88087D8556D276A9E5B8E37E6×tamp=1629525680&nonce=5c672d4e9628d0a7' \
--header 'bear: 157E4A5D-3877-1236-DE06-457FT3F70C4' \
--header 'Content-Type: application/json' \
--data '{"app_list":[{"app_uuid":"","app_name":"API\u5e94\u7528","os":1,"package_name":"api","app_url":"","category_id":101,"direction":1}]}'
返回样例:
{
"code": 200,
"status": 0,
"data": {
"list": [
{
"app_uuid": "",
"app_name": "a1",
"error_message": "应用名称已存在"
},
{
"app_uuid": "A741926221D7FEFBCB179D08B4477713",
"app_name": "test1",
"error_message": ""
}
]
}
}
5 广告位管理
5.1 获取广告位
请求路径: /api/seat/seats
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| app_uuid | Stirng | N | 单个应用 ID,可以获取某个应用下的所有广告位 | app_uuid 和 adseat_uuid 互斥 都传只取 app_uuid |
| adseat_uuids | String | N | 广告位 ID,多个逗号分割, 最多返回100 | |
| page | String | N | 页数 默认1 | 每页100条 |
返回字段:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| has_more | Int | N | ||
| total | Int | N | ||
| adseat_list | Array | Y | ||
| adseat_list.app_uuid | String | Y | 开发者应用 ID | |
| adseat_list.seat_name | String | Y | 广告位名称 | |
| adseat_list.adseat_uuid | String | Y | 广告位 ID | |
| adseat_list.adseat_label | String | Y | 广告位类型标签,只读。normal 普通广告位;shared 共享主广告位;intelligent 智能策略广告位(含主广告位与子广告位)。每个广告位仅返回一个标签;绑定共享的广告位(非共享主广告位)返回 normal | |
| adseat_list.cache_num | Int | Y | 并行请求数 | |
| adseat_list.ad_type | Int | Y | 广告类型: 1 原生 2 插屏 3 开屏 4 横幅 5 激励视频 7 互动广告 8 插播 | |
| adseat_list.use_frequency | Int | Y | 是否设置展示频次上线:1 是 0 否 | |
| adseat_list.frequency_limit | Int | Y | 展示数上限 | |
| adseat_list.frequency_unit_count | Int | Y | 单位间隔 | |
| adseat_list.frequency_unit | Int | Y | 次数单位:1 分钟 2 小时 3 天 | eg: 每5(frequency_unit_count) 分钟 (frequency_unit) 展示10次(frequency_limit) |
| adseat_list.ad_type_template | Int | N | 原生模版类型 标准原生: 1 原生横幅: 2 Draw 信息流: 3 原生开屏: 4 | 原生类型返回 |
| adseat_list.refresh_time | Int | N | 刷新时间 | 原生横幅,横幅返回 |
| adseat_list.skip_time | Int | N | n 秒后显示跳过按钮 | 开屏,原生开屏类型返回 |
| adseat_list.countdown_time | Int | N | 倒计时总时长 | 开屏,原生开屏类型返回 |
| adseat_list.is_skip | Int | N | 是否可跳过 | 开屏,原生开屏字类型返回 |
| adseat_list.monetary_name | String | N | 奖励项目 | 激励视频类型返回 |
| adseat_list.monetary | Int | N | 奖励数量 | 激励视频类型返回 |
| adseat_list.is_server_callback | Int | N | 奖励回调开关 | 1 开 0 关;激励视频返回 |
| adseat_list.callback_url | String | N | 奖励回调 URL | |
| adseat_list.secret_key | String | N | 奖励回调密钥 | 明文;系统生成,只读 |
| adseat_list.imp_is_server_callback | Int | N | 展示回调开关 | 1 开 0 关 |
| adseat_list.imp_callback_url | String | N | 展示回调 URL | |
| adseat_list.imp_secret_key | String | N | 展示回调密钥 | 明文;系统生成,只读 |
| adseat_list.imp_callback_type | Int | N | 展示回调类型 | 1 普通 2 精准 |
请求示例
curl --location --request POST 'https://openapi.tradplusad.com/api/seat/seats?sign=5DE008C88087D8556D276A9E5B8E37E6×tamp=1629525680&nonce=5c672d4e9628d0a7' \
--header 'bear: 157E4A5D-3877-1236-DE06-457FT3F70C4' \
--header 'Content-Type: application/json' \
--data '{"app_uuid":"348FA2C4CFA91471D09DC529EAB1459E", "adseat_uuids":"","page":1}'
返回样例:
{
"code": 200,
"status": 0,
"data": {
"has_more": 0,
"total": 58,
"adseat_list": [
{
"app_uuid": "A741926221D7FEFBCB179D08B4477713",
"seat_name": "cp1",
"adseat_uuid": "E1FF0FF0BFF1EBDB61C0FED50E66229D",
"adseat_label": "normal",
"ad_type": 2,
"cache_num": 2,
"use_frequency": 0,
"frequency_limit": 0,
"frequency_unit_count": 0,
"frequency_unit": 0
},
{
"app_uuid": "1BCEFCAD3011A276134CC6225E724064",
"seat_name": "bzys",
"adseat_uuid": "D202406D331F32A5BBD1231065BAD7A0",
"adseat_label": "normal",
"ad_type": 1,
"cache_num": 2,
"use_frequency": 0,
"frequency_limit": 0,
"frequency_unit_count": 0,
"frequency_unit": 0,
"ad_type_template": 1
},
...
]
}
}
5.2 创建和编辑广告位
请求路径: /api/seat/store
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| adseat_list | Array | Y | 最多10个超过会被丢弃 | |
| adseat_list.app_uuid | String | Y | 开发者应用 ID | 开发者应用 ID ,创建后不可编辑。 |
| adseat_list.seat_name | String | Y | 广告位名称 创建必传 | |
| adseat_list.adseat_uuid | String | N | 广告位 ID 编辑必传 | |
| adseat_list.cache_num | Int | N | 广告并行请求数。未传时默认 2;互动广告(7)默认 1,插播(8)默认 2 | 开屏范围:1 |
| adseat_list.ad_type | Int | Y | 广告类型: 1 原生 2 插屏 3 开屏 4 横幅 5 激励视频 7 互动广告 8 插播 | 广告类型,创建必传,创建后不可编辑。 |
| adseat_list.use_frequency | Int | N | 是否设置展示频次上线:默认否 | 1 是 0 否 |
| adseat_list.frequency_limit | Int | N | 展示数上限 n 次展示,默认 1 | |
| adseat_list.frequency_unit_count | Int | N | 单位间隔, 默认 1 | |
| adseat_list.frequency_unit | Int | N | 次数单位, 分钟:1 小时: 2 天:3 默认 1 | |
| adseat_list.ad_type_template | Int | N | 1 标准原生 2 原生横幅 3 Draw 信息流 4 原生拼接开屏 | 创建原生类型必传,创建后不可编辑。 |
| adseat_list.refresh_time | Int | N | 自动刷新,范围:15~150秒 | 仅对横幅与原生横幅生效 可以不传,表示不刷新 |
| adseat_list.skip_time | Int | N | n 秒后显示跳过按钮 范围:0~10秒 默认为2 | 创建开屏与原生开屏必传,仅对开屏与原生开屏生效 |
| adseat_list.countdown_time | Int | N | 倒计时总时长 范围:3~10秒, 默认 5 | 创建开屏与原生开屏必传 仅对开屏与原生开屏生效 倒计时总时长必须大于 skip_time |
| adseat_list.is_skip | Int | N | 是否可跳过,1是 0否, 默认是 | 创建开屏与原生开屏必传,仅对开屏与原生开屏生效 |
| adseat_list.monetary_name | String | N | 奖励项目 | 仅对激励视频生效 |
| adseat_list.monetary | Int | N | 奖励数量 | 仅对激励视频生效 |
| adseat_list.is_server_callback | Int | N | 奖励回调开关 | 仅激励视频;1=开时须同时传 callback_url。密钥由系统生成,查询列表明文回显。非激励广告位传奖励回调字段会报「非激励视频无需设置奖励回调」 |
| adseat_list.callback_url | String | N | 奖励回调 URL | 最长 2000 |
| adseat_list.refresh_secret_key | Int | N | 刷新奖励回调密钥 | 仅编辑;1=换新密钥 |
| adseat_list.imp_is_server_callback | Int | N | 展示回调开关 | 1=开时须同时传 imp_callback_url。密钥由系统生成 |
| adseat_list.imp_callback_url | String | N | 展示回调 URL | 最长 2000 |
| adseat_list.refresh_imp_secret_key | Int | N | 刷新展示回调密钥 | 仅编辑;1=换新密钥 |
| adseat_list.imp_callback_type | Int | N | 展示回调类型 | 1 普通 2 精准。只要传了且不是 1 或 2(如 99),无论回调开或关都报「 展示回调类型参数设置错误」。0 或不传不报错 |
打开激励视频奖励回调时只传开关和地址,创建成功后用 /api/seat/seats 读 secret_key。换钥时编辑传 refresh_secret_key=1(展示回调用 refresh_imp_secret_key=1)。
{"adseat_list":[{"app_uuid":"<app_uuid>","seat_name":"激励01","ad_type":5,"is_server_callback":1,"callback_url":"https://example.com/reward"}]}
{"adseat_list":[{"app_uuid":"<app_uuid>","adseat_uuid":"<adseat_uuid>","refresh_secret_key":1}]}
返回字段:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| list | Array | Y | ||
| list.adseat_uuid | String | Y | ||
| list.seat_name | String | Y | ||
| list.error_message | String | Y | 错误信息,空字符表示成功 |
请求示例
curl --location --request POST 'https://openapi.tradplusad.com/api/seat/store?sign=5DE008C88087D8556D276A9E5B8E37E6×tamp=1629525680&nonce=5c672d4e9628d0a7' \
--header 'bear: 157E4A5D-3877-1236-DE06-457FT3F70C4' \
--header 'Content-Type: application/json' \
--data '{"adseat_list":[{"app_uuid":"BA04D9C5A5E736CCDA8003BC5D936BE5","seat_name":"API\u521b\u5efa","ad_type":"5","adseat_uuid":""}]}'
返回样例:
{
"code": 200,
"status": 0,
"data": {
"list": [
{
"adseat_uuid": "9D0A151A3B9169369CB75873FD86713E",
"seat_name": "test原生横幅",
"error_message": ""
},
{
"adseat_uuid": "",
"seat_name": "",
"error_message": "应用id必填"
}
]
}
}
6 中介组管理
6.1 查询中介组列表
请求路径: /api/intermediary/group_list
请求参数:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| currency | String | Y | 货币单位,USD 或 CNY |
| adseat_uuid | String | Y | 广告位 uuid |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| abtest_name | String | Y | AB 测试组名称 |
| bucket_id | String | Y | AB 分组 id |
| group_id | String | Y | 中介组 id |
| group_name | String | Y | 中介组名称 |
| bidding_adsource_cache_num | String | Y | Bidding 广告源保留数 |
| bidding_floor_price | String | Y | Bidding 底价;单位与请求 currency 一致,0 表示不设底价 |
| cache_num | String | Y | 并行请求数 |
| is_preset | String | Y | 是否预置中介组 1-是 0-否 |
| is_cold_scene | String | Y | 是否冷启动 1-是 0-否 |
| country | String | Y | 国家地区 |
| city | String | Y | 城市 |
| rule_json | String | Y | 流量分组规则 |
| segment_tag | String | Y | 自定义用户属性 |
| status | String | Y | 状态 1-开启 2-关闭 |
| preset_country | String | Y | 预置中介组国家 |
| min_cache | String | N | 最小缓存数 |
| ad_fill_callback | String | N | 广告填充回调:1 eCPM 优先,2 速度优先 |
| sdk_request_adsource_timeout | String | N | 广告源请求超时,单位秒 |
| sdk_bidding_timeout | String | N | 服务端竞价超时,单位秒 |
| sdk_c2s_bidding_timeout | String | N | C2S 竞价超时,单位秒 |
| sdk_load_max_wait_time | String | N | eCPM 优先最大等待,单位秒;0 表示不设等待 |
| frequency_capping_hour | String | N | 每小时展示上限:0 不限制,1–1000 为次数 |
| frequency_capping_day | String | N | 每天展示上限:0 不限制,1–1000 为次数 |
| frequency_pacing_min | String | N | 展示间隔,单位分钟:0 不限制,1–1000 为间隔 |
| request_fail_retry | String | N | 请求失败重试(仅开屏):0 关 1 开 |
| is_refresh | String | N | 自动刷新(横幅) |
| refresh_time | String | N | 刷新时长(横幅) |
请求示例
curl --location 'https://openapi.tradplusad.com/api/intermediary/group_list' \
--header 'bear: EEB82554-BD76-1474-EB7E-3785B5107872' \
--header 'Content-Type: application/json' \
--data '{"currency": "USD","adseat_uuid": "15974C36532C36C820D5B9AAEC21EB12"}'
返回样例:
{
"code": 200,
"status": 0,
"data": [
{
"group_id": "56646",
"group_name": "自定义",
"bucket_id": "8094",
"bidding_adsource_cache_num": "2",
"bidding_floor_price": "0",
"cache_num": "2",
"is_preset": "0",
"is_cold_scene": "0",
"country": "",
"city": "",
"rule_json": "{}",
"segment_tag": "",
"status": "1",
"preset_country": "",
"abtest_name": "对照组"
},
{
"group_id": "0",
"group_name": "所有国家",
"bucket_id": "8094",
"bidding_adsource_cache_num": "2",
"bidding_floor_price": "0",
"cache_num": "2",
"is_preset": "0",
"is_cold_scene": "0",
"country": "",
"city": "",
"rule_json": "{}",
"segment_tag": "",
"status": "1",
"preset_country": "",
"abtest_name": "对照组"
},
{
"group_id": "56647",
"group_name": "自定义",
"bucket_id": "8095",
"bidding_adsource_cache_num": "2",
"bidding_floor_price": "0",
"cache_num": "2",
"is_preset": "0",
"is_cold_scene": "0",
"country": "",
"city": "",
"rule_json": "{}",
"segment_tag": "",
"status": "1",
"preset_country": "",
"abtest_name": "实验组1"
},
{
"group_id": "0",
"group_name": "所有国家",
"bucket_id": "8095",
"bidding_adsource_cache_num": "2",
"bidding_floor_price": "0",
"cache_num": "2",
"is_preset": "0",
"is_cold_scene": "0",
"country": "",
"city": "",
"rule_json": "{}",
"segment_tag": "",
"status": "1",
"preset_country": "",
"abtest_name": "实验组1"
}
]
}
6.2 创建和编辑中介组
请求路径: /api/intermediary/store
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| currency | String | Y | 货币单位,USD 或 CNY | |
| group_list | Array | Y | 中介组列表 | 最多10个超过会被丢弃 |
| group_list.group_id | int | N | 中介组 ID | 编辑必传,如果传入 0 ,会更新默认组 |
| group_list.group_name | String | Y | 中介组名称 | |
| group_list.adseat_uuid | String | Y | 广告位 ID | |
| group_list.bucket_id | Int | Y | AB 分组 id | 不支持编辑 |
| group_list.is_preset | Int | Y | 预置中介组 | 1-是 0-否,不支持编辑 |
| group_list.is_cold_scene | Int | Y | 冷启动 | 1 是 0 否,仅开屏支持,不支持编辑 |
| group_list.bidding_floor_price | float | N | Bidding 底价 | 非负小数,单位与本次请求 currency 一致(USD 或 CNY)。0 表示不设底价。需账号所属公司级别为二级(中级)、三级(高级)或九级(默认);一级(初级)传此字段会报「没有权限设置中介组Bidding底价」。更新未传则保持原值 |
| group_list.cache_num | Int | Y | 并行请求数 | 上限为20。更新未传沿用该组已有值;创建未传才按广告类型默认(开屏/互动广告 1,其他 2) |
| group_list.bidding_adsource_cache_num | Int | Y | Bidding 广告源保留数 | -1表示不限,限制的上限为20 |
| group_list.country | Int | N | 国家/地区 | 国家 ISO 码,多选英文逗号隔开,参考8.1 |
| group_list.city | Int | N | 省份城市 | 省份城市 ID,多选逗号隔开,参考8.2 |
| group_list.segment_tag | Int | N | 开发者自定义 Segment Tag | 多个 Segment Tag 英文逗号隔开 |
| group_list.preset_country | String | N | 预置中介组国家 | 国家 ISO 码,多选英文逗号隔开 |
| group_list.placement_ids | String | N | 广告源 ID | 多选英文逗号隔开 |
| group_list.rule_json | String | N | 流量分组规则 | json 格式 参考附录3 |
| group_list.min_cache | Int | N | 最小缓存数 | 不能大于本次将写入的 cache_num。更新未传并行数时按该组已有值比较;更新未传最小缓存则保持原值 |
| group_list.sdk_request_adsource_timeout | Int | N | 广告源请求超时 | 单位秒,非负整数。需公司开通 request_ad_timeout 权限,否则报「没有权限设置SDK请求超时」。更新未传则保持原值 |
| group_list.sdk_bidding_timeout | Int | N | 服务端竞价超时 | 单位秒,非负整数。需公司开通 request_ad_timeout 权限,否则报「没有权限设置SDK请求超时」。更新未传则保持原值 |
| group_list.sdk_c2s_bidding_timeout | Int | N | C2S 竞价超时 | 单位秒,非负整数。不需要 request_ad_timeout 权限。更新未传则保持原值 |
| group_list.sdk_load_max_wait_time | Int | N | eCPM 优先最大等待 | 单位秒;0 表示不设等待。速度优先(ad_fill_callback=2)不能带正数等待,否则报「速度优先不能设置最大等待时长」。未传填充回调或 =1 时可大于 0。更新未传则保持原值 |
| group_list.ad_fill_callback | Int | N | 广告填充回调 | 1=eCPM 优先,2=速度优先。需账号所属公司级别为三级(高级)或九级(默认);一级(初级)、二级(中级) 传此字段会报「没有权限设置广告填充回调」。更新未传则保持原值 |
| group_list.frequency_capping_hour | Int | N | 每小时展示上限 | 该中介组每小时最多展示次数。0=不限制;1–1000=上限次数。更新未传则保持原值 |
| group_list.frequency_capping_day | Int | N | 每天展示上限 | 该中介组每天最多展示次数。0=不限制;1–1000=上限次数。更新未传则保持原值 |
| group_list.frequency_pacing_min | Int | N | 展示间隔 | 两次展示的最小间隔,单位分钟。0=不限制;1–1000=间隔分钟。更新未传则保持原值 |
| group_list.request_fail_retry | Int | N | 请求失败重试 | 仅开屏(ad_type=3)。0=关,1=开。其他广告类型传此字段会报「request_fail_retry不适用于当前广告类型」。更新未传则保持原值 |
| group_list.is_refresh | Int | N | 自动刷新 | 仅横幅;1=开须带 refresh_time(5–180,可沿用库里旧值);0=关时不要同时传时长 |
| group_list.refresh_time | Int | N | 刷新时长 | 仅横幅;开启时 5–180 秒 |
上表里超时、频控、开屏重试、组底价、并行请求数、最小缓存、发布地区等互不联动:更新时只传要改的键,未出现的键保持原值。表格中标必传的 ident(group_id、group_name、adseat_uuid、bucket_id、is_preset、is_cold_scene)仍要带。
例如已有中介组 56657,只把每小时展示上限改成 10 次,不必同时改超时或底价:
{"currency":"USD","group_list":[{"group_id":56657,"group_name":"自定义","adseat_uuid":"8C321665C992CDDBE6F5892409A67612","bucket_id":0,"is_preset":0,"is_cold_scene":0,"frequency_capping_hour":10}]}
横幅自定义组并行数已是 10、最小缓存已是 8 时,上面这种不传 cache_num / min_cache 的更新会保持 10 和 8,不会把并行数改成横幅类型默认 2。
只改发布地区时,ident 仍按应用 store 表填写,再加 app_release_region(1 全球 / 2 中国 / 3 海外):
{"app_list":[{"app_uuid":"A741926221D7FEFBCB179D08B4477713","app_name":"test1","app_release_region":2}]}
返回字段:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| list | Array | Y | ||
| list.group_id | String | Y | ||
| list.group_name | String | Y | ||
| list.error_message | String | Y | 错误信息,空字符表示成功 |
请求示例
curl --location 'https://openapi.tradplusad.com/api/intermediary/store' \
--header 'bear: EEB82554-BD76-1474-EB7E-3785B5107872' \
--header 'Content-Type: application/json' \
--data '{"currency": "USD","group_list": [{"group_id":56657,"group_name":"自定义","adseat_uuid":"8C321665C992CDDBE6F5892409A67612","bucket_id":0,"is_preset":0,"is_cold_scene":0,"bidding_floor_price":1,"cache_num":0,"country":"US,JP","city":"","bidding_adsource_cache_num":-1,"segment_tag":"","rule_json":"{\"rules\":[{\"name\":\"app_ver\",\"type\":\"version\",\"op\":\"in\",\"data\":[\"1\",\"2\"]}],\"timezoneOffset\":\"0\"}","placement_ids":"653046","preset_country":"AM,DE,SG"}]}'
返回样例:
{
"code": 200,
"status": 0,
"data": {
"list": [
{
"group_id": "",
"group_name": "",
"error_message": ""
}
]
}
}
6.3 查询中介组广告源列表
请求路径: /api/intermediary/group_placements
请求参数:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| currency | String | Y | 货币单位,USD 或 CNY |
| adseat_uuid | String | Y | 广告位 uuid |
| bucket_id | Int | N | AB 分组 id |
| group_id | Int | N | 中介组 id |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| adseat_uuid | String | Y | |
| bucket_id | String | Y | AB 分组 id |
| group_id | String | Y | 中介组 id |
| placement_list | Array | Y | 中介组广告源列表 |
| placement_list.bucket_id | Obj | Y | AB 分组 id |
| placement_list.bucket_id.group_id | Obj | Y | 中介组 id |
| placement_list.bucket_id.group_id.header_bidding_list | Array | N | HeaderBidding 区域 |
| placement_list.bucket_id.group_id.auto_optimization_list | Array | N | 按价格排序区域 |
| placement_list.bucket_id.group_id.manual_sorting_list | Array | N | 手动序区域 |
| placement_list.bucket_id.group_id.low_priority_list | Array | N | 低优先级区域 |
| placement_list.bucket_id.group_id.closed_list | Array | N | 在中介组关闭的广告源 |
| 对应列表内容: | |||
| id | String | Y | 中介组广告源 id |
| status | String | Y | 中介组广告源状态 1开启 0关闭 |
| adsource_id | String | Y | 广告网络 id |
| group_id | String | Y | 中介组 id |
| group_name | String | Y | 中介组名称 |
| bucket_id | String | Y | AB 分组 id 数组 |
| bucket_name | String | Y | AB 分组名称 |
| is_header_bidding | String | Y | 是否开启 Header Bidding 1 是 0 否 |
| is_auto_price | String | Y | 是否开启自动价格 1 开启 2 关闭 |
| ecpm_forcast | String | Y | 预测 ecpm |
| rate | String | Y | 排序价格 |
| bid_floor | String | Y | bid 底价 |
| fequency_capping_day | String | Y | 频次配置,展示上限(每天) |
| frequency_capping_hour | String | Y | 频次配置,展示上限(每小时) |
| fequency_capping_min | String | Y | 频次配置,展示上限(每分钟) |
| sdk_request_timeout | String | Y | SDK 请求广告超时时长 |
| request_interval_status | String | Y | 请求间隔控制,1 开启 2 关闭 |
| request_no_fill_num | String | Y | 请求间隔控制,连续无填充次数 |
| request_interval | String | Y | 请求间隔控制,请求间隔,单位秒 |
| auto_optimization | String | Y | 排序区域 1 按价格排序 2 手动排序 3 低优先级 |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"adseat_uuid": "08056F3650B0B65B79714A1482FE5EEE",
"group_id": "",
"bucket_id": "",
"placement_list": {
"0": {
"0": {
"auto_optimization_list": {
"0": {
"id": "157751",
"status": "1",
"adsource_id": "16",
"group_id": "0",
"group_name": "默认组",
"bucket_id": "0",
"bucket_name": "",
"is_header_bidding": "0",
"is_auto_price": "1",
"ecpm_forcast": "",
"rate": "3",
"fequency_capping_day": "",
"frequency_capping_hour": "",
"fequency_capping_min": "",
"sdk_request_timeout": "10",
"request_interval_status": "",
"request_no_fill_num": "",
"request_interval": "",
"auto_optimization": "1"
}
}
},
"2396": {
"auto_optimization_list": {
"0": {
"id": "157801",
"status": "1",
"adsource_id": "16",
"group_id": "2396",
"group_name": "cn 组",
"bucket_id": "0",
"bucket_name": "",
"is_header_bidding": "0",
"is_auto_price": "1",
"ecpm_forcast": "",
"rate": "3",
"fequency_capping_day": "2",
"frequency_capping_hour": "1",
"fequency_capping_min": "3",
"sdk_request_timeout": "10",
"request_interval_status": "1",
"request_no_fill_num": "3",
"request_interval": "180",
"auto_optimization": "1"
}
}
}
}
}
}
}
6.4 批量修改广告源在中介组的属性(需要开启新 AB 测试权限)
请求路径: /api/intermediary/update_group_placement
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| currency | String | Y | 币种单位 CNY 或 USD | |
| placement_list | Array | Y | 中介组广告源数组 | 一次最多10个 |
| placement_list.id | Int | Y | 中介组广告源 id | |
| placement_list.sdk_request_timeout | Int | N | SDK 请求广告超时时长 | |
| placement_list.fequency_capping_day | Int | N | 频次配置,展示上限(每天) | |
| placement_list.frequency_capping_hour | Int | N | 频次配置,展示上限(每小时) | |
| placement_list.fequency_capping_min | Int | N | 频次配置,展示上限(每分钟) | |
| placement_list.request_interval_status | Int | N | 请求间隔控制 1 开启 2 关闭 | |
| placement_list.request_no_fill_num | Int | N | 请求间隔控制 连续无填充次数 | |
| placement_list.request_interval | Int | N | 请求间隔控制 求间隔,单位秒 | |
| placement_list.is_auto_price | Int | N | 是否开启自动价格 1 开启 2 关闭 | |
| placement_list.rate | Int | N | 排序价格 可选范围0.01 - 10000 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| data | Array | Y | |
| data.placement_id | Int | Y | 中介组广告源 id |
| data.error_message | String | Y | 错误信息 |
返回样例:
{
"code": 200,
"status": 0,
"data": [
{
"placement_id": 157651,
"error_message": ""
},
{
"placement_id": 157652,
"error_message": ""
},
{
"placement_id": 122,
"error_message": "广告源错误"
}
]
}
6.5 开启或关闭中介组广告源
请求路径: /api/intermediary/on_off_placement
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| status | Int | Y | 状态 1 启用 0 停用 | |
| placement_id_list | Array | Y | 中介组广告源 id 数组 | 一次最多10个 |
| placement_id_list.id | Int | Y | 中介组广告源 id |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| data | Array | Y | |
| data.placement_id | Int | Y | 中介组广告源 id |
| data.error_message | String | Y | 错误信息 |
返回样例:
{
"code": 200,
"status": 0,
"data": [
{
"placement_id": 157651,
"error_message": ""
},
{
"placement_id": 157652,
"error_message": ""
},
{
"placement_id": 122,
"error_message": "广告源错误"
}
]
}
6.6 调整中介组排序
请求路径: /api/intermediary/update_group_sort
在同一广告位、同一 AB 分组下,调整全部自定义中介组的优先级。列表中第一个组优先级最高。默认「所有国家」组(group_id = 0)不参与排序。需具备 API 更新权限。
请求参数:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| currency | String | Y | 货币单位,USD 或 CNY |
| adseat_uuid | String | Y | 广告位 UUID |
| bucket_id | Int | Y | AB 分组 ID;无 AB 测试时传 0 |
| group_list | Array | Y | 中介组 ID 数组,按优先级从高到低;必须包含该 adseat_uuid + bucket_id 下全部自定义中介组;不可含默认组 0;不可重复 |
约束:
group_list必须与当前 AB 分组下已有自定义中介组集合完全一致(不可缺少、不可多传、不可跨广告位或跨 AB 分组)- 已开启智能托管的广告位不可调用本接口
- 子账号 API Key 仅可操作其授权应用范围内的广告位
返回字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| data.group_list | Array | 提交成功的排序结果(与请求中的 group_list 一致) |
请求示例
curl --location --request POST 'https://api-developer.tradplusad.com/api/intermediary/update_group_sort' \
--header 'bear: EEB82554-BD76-1474-EB7E-3785B5107872' \
--header 'Content-Type: application/json' \
--data '{"currency": "USD","adseat_uuid": "8C321665C992CDDBE6F5892409A67612","bucket_id": 0,"group_list": [11, 33, 22]}'
返回样例:
{
"code": 200,
"status": 0,
"data": {
"group_list": [11, 33, 22]
}
}
7 广告源管理
7.1 查询广告网络授权信息
请求路径: /api/PlacementApiToken/api_tokens
请求参数:无
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| data | Array | Y | |
| data.api_token_id | Int | Y | 网络授权 id |
| data.account_name | String | Y | 账号名称 |
| data.adsource_id | Int | Y | 广告网络 id |
| data.is_open | Int | Y | 是否开通 1 是 0 否 |
返回样例:
{
"code": 200,
"status": 0,
"data": [
{
"id": 1466,
"account_name": "默认账号",
"adsource_id": 17,
"is_open": 0
},
{
"id": 2796,
"account_name": "默认账号",
"adsource_id": 43,
"is_open": 0
}
]
}
7.2 查询广告源信息
请求路径: /api/placement/placements
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| currency | String | Y | 币种单位 CNY 或 USD | |
| placement_ids | String | N | 广告源 id | 逗号分割, 最多100个 |
| adsource_ids | String | N | 广告网络 id | 逗号分割 |
| app_uuids | String | N | 应用 id | 逗号分割, 最多100个 |
| adseat_uuids | String | N | 广告位 id | 逗号分割, 最多100个 |
| fields | String | N | 需要返回的字段 | 默认所有 |
| page | Int | N | 页数 默认1 | 每页100条 |
| is_on | Int | N | 筛选广告源启用状态:默认 1 | 0 仅返回已关闭;1 仅返回已开启;-1 返回开启+关闭(全部);不传或空 时行为与历史一致,默认仅已开启 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| has_more | Int | Y | 是否还有更多 1 是 0 否 |
| placements | Array | Y | |
| placements.placement_id | String | 广告源 id | |
| placements.name | String | 广告源名称 | |
| placements.adsource_id | String | 广告网络 id | |
| placements.is_native | String | 广告支持类型 | 0 普通、1 原生、99 内嵌式自适应(仅 AdMob、Google Ad Manager 横幅) |
| placements.is_header_bidding | String | 是否开启 Header Bidding | |
| placements.placement_config | Json | 广告位参数配置 | demo:{"appId":"5175107","placementId":"946159096","adsource_type": "1"} |
| placements.api_token_id | String | 授权 id | |
| placements.account_name | String | 授权账号名称 | |
| placements.app_uuid | String | 应用 ID | |
| placements.app_name | String | 应用名称 | |
| placements.os | String | 应用系统 1 Android 2 ios | |
| placements.adseat_uuid | String | 广告位 uuid | |
| placements.seat_name | String | 广告位名称 | |
| placements.ad_type | String | 广告位类型 | |
| placements.intermediary_group | Array | 中介组广告源信息 参考6.1 |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"placements": [
{
"placement_id": "23399",
"name": "Pangle(cn)_int_1",
"adsource_id": "17",
"is_header_bidding": "0",
"placement_config": {
"appId": "5175107",
"placementId": "946159096",
"adsource_type": "1",
"app_download_setup": "0",
"popconfirm": "0",
"is_template_rendering": "1"
},
"api_token_id": "1466",
"account_name": "默认账号",
"app_uuid": "6B5AE472641DB544632AE2E84F952658",
"app_name": "火柴人大乱斗",
"os": "1",
"adseat_uuid": "6ECF7327CD62D9BAC9965FC57CC27249",
"seat_name": "插屏广告",
"ad_type": "2",
"currency": "USD",
"intermediary_gorup": [
{
"id": "33489",
"status": "1",
"group_id": "0",
"group_name": "默认组",
"bucket_id": "0",
"bucket_name": "",
"is_auto_price": "1",
"ecpm_forcast": "",
"rate": "0",
"fequency_capping_day": "",
"frequency_capping_hour": "",
"fequency_capping_min": "",
"sdk_request_timeout": "60",
"auto_optimization": "1",
"sort": "0"
}
]
}
],
"has_more": 0
}
}
7.3 创建和编辑广告源信息(需要开启新 AB 测试权限)
支持创建和编辑的广告源: 参考 附录2
请求路径: /api/placement/store
请求参数:
1 创建广告源
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| currency | String | Y | 币种单位 CNY 或 USD | |
| placement_list | Array | Y | 广告源配置 | 一次最多10个 |
| placement_list.name | String | Y | 广告源名称 | 同一个广告位下不允许重复 |
| placement_list.api_token_id | Int | Y | 网络授权 id | 参考7.1 |
| placement_list.adsource_id | Int | Y | 广告网络 id | 参考8.2 |
| placement_list.adseat_uuid | String | Y | 广告位 uuid | 广告位类型支持的广告源,参考 附录2 |
| placement_list.is_header_bidding | Int | N | 是否开启 Header Bidding | 1 是, 0 否 参考 附录1 |
| placement_list.is_auto_price | Int | N | 是否开启自动价格 | 1 开启, 2 关闭, 非 Header Bidding 必填 |
| placement_list.rate | Float | N | 排序价格 | 关联 currency,非 Header Bidding 必填,且必须大于0.01小于10000 |
| placement_list.placement_config | Json | Y | 广告源参数配置 | 参考 附录2;AdMob、Unity Ads 见下文填写说明 |
| placement_list.is_native | Int | N | 广告支持类型 | 0 普通、1 原生;仅限横幅、开屏、插屏广告位(横幅:0 普通横幅,1 原生横幅;开屏、插屏同理)。AdMob、Google Ad Manager 横幅另支持 99 内嵌式自适应;Meta 横幅另支持 13 原生拼横幅,见下文填写说明。创建与查询广告源时均返回本字段。 |
| placement_list.is_bottom | Int | N | 兜底广告 | 1 是 0 否;开启 Header Bidding 该字段无效 |
| placement_list.is_auto_create | Int | N | 是否自动化创建 | 1-是 0-否,目前支持 Meta、AdMob、Pangle、Mintegral、Vungle、Digital Turbine、Bigo、Yandex、TaurusX、Inmobi、YSO、Unity Ads |
| placement_list.auto_app_id | string | N | 自动化创建顶层 App ID | Meta、Inmobi、Yandex、YSO 自动化必填(is_auto_create=1);AdMob、Digital Turbine、Unity Ads 勿传,应用 / Game ID 填写 placement_config.appId |
| placement_list.group_list | Array | N | 加入的中介组 | 传入则必须传全量(含空数组)。[] 会关掉该广告源下全部组关系。省略则加入广告位下全部中介组。非空时每项须含 group_id、bucket_id、adseat_id(广告位数字 ID,不是 adseat_uuid),且必须属于当前广告位。可选:selected(1=该组开启,不传默认 1;0=关闭)、rate(排序价格,不传默认 0,单位与 currency 一致)、is_auto_price(不传默认 0)。组对不上会报错、不改库。通过后先把该广告源下所有组关系 status=0,再按列表恢复;只传要开的组、漏掉其余 → 其余会被关掉 |
| placement_list.bidding_floor_price | Float | N | 广告源 Bidding 底价 | 仅 is_header_bidding=1 时可写。单位与本次请求 currency 一致(USD 或 CNY)。非 ADX 需 HB_FLOOR_PRICE 权限,否则报错;TradPlus ADX / SAAS ADX 无权限时按 0 写入。更新未传则保持原值 |
| placement_list.is_modify_pid | Int | N | 是否同步修改 PID | 仅编辑;创建传 1 会报「创建广告源不支持同步修改PID」。1=按后台规则把 PID 同步到同应用其他广告位,需 modify_placement 权限。若其他广告位仍占用旧 PID、同时又已有广告位占用新 PID,返回「广告位下已存在相同广告源参数」,本条不写库 |
AdMob(adsource_id=2)appId / placementId 填写说明
| 创建方式 | 操作系统 | placement_config.appId | placement_config.placementId |
|---|---|---|---|
手动 is_auto_create=0 | Android | 必填、非空 | 必填、非空(广告单元 ID,如 ca-app-pub-xxx/yyy) |
手动 is_auto_create=0 | iOS | 必填、非空(同 Android) | 必填、非空(同 Android) |
自动化 is_auto_create=1 | Android | 必填、非空(须为已在 AdMob 创建的应用 ID) | key 必传,值可为 "",系统创建广告单元后回填 |
自动化 is_auto_create=1 | iOS | 必填、非空(同 Android) | key 必传,值可为 ""(同 Android) |
校验错误:缺失 appId 返回 appId广告位配置参数缺失;appId 为空字符串返回 appId广告位配置参数不能为空。
Unity Ads(adsource_id=5)appId / placementId 填写说明
| 创建方式 | placement_config.appId | placement_config.placementId |
|---|---|---|
手动 is_auto_create=0 | 必填、非空,Unity Game ID | 必填、非空,已有 Unity Placement ID |
自动化 is_auto_create=1 | 必填、非空,Unity Game ID | 可省略或传空串;系统调用 Unity placements API 创建后,以三方返回 id 回写 |
开屏广告位仅支持插屏开屏:传 is_native=0、placement_config.placement_ad_type=2(必填;缺失返回 placement_ad_type样式配置参数缺失,非 2 返回 placement_ad_type配置参数错误)。
Unity Ads 自动化创建填写说明
| 项 | 说明 |
|---|---|
| 广告类型 | 仅支持横幅、插屏、激励视频、开屏;其他类型返回「广告类型不支持自动化创建」 |
| Header Bidding | 不支持。is_header_bidding=1 返回「Unity自动化创建不支持Bidding源」 |
| 授权 | api_token_id 对应的 Unity 授权须开启自动化;未开启返回「网络授权id不支持自动化创建」 |
auto_app_id | 勿传;Game ID 填写 placement_config.appId |
| 横幅 | ad_size 必填,取值 1(320 x 50)或 2(728 x 90);缺失返回 ad_size样式配置参数缺失,非法值返回 ad_size配置参数错误 |
| 开屏 | 仅插屏开屏(placement_ad_type=2);Unity 将开屏与插屏都作为 interstitial Ad Unit 处理 |
Digital Turbine(adsource_id=24)自动化创建填写说明
| 项 | 说明 |
|---|---|
placement_config.appId | 必填,Digital Turbine App ID |
placement_config.placementId | 可省略或传空串;创建成功后以 Digital Turbine 返回的 ID 回填 |
| 广告类型 | 支持横幅、插屏、激励视频、插屏开屏;开屏须 is_native=0 且 placement_ad_type=2 |
| 样式 | 插屏和插屏开屏须传 video_mute(1=是,2=否) |
| Header Bidding | 不支持,须传 is_header_bidding=0 |
YSO(adsource_id=77)自动化创建填写说明
| 项 | 说明 |
|---|---|
auto_app_id | 必填,YSO App Key |
placement_config.placementId | 可省略或传空串;创建成功后以 YSO 返回的 data.key 回填 |
| 广告类型 | 仅支持横幅、插屏、激励视频 |
| Header Bidding | 必须开启;仅支持 S2S(header_bidding_type=0) |
zMaticoo(adsource_id=55)手动创建填写说明
placement_config 须包含非空 AppKey 与 placementId。仅支持手动创建和普通瀑布流;原生横幅须 native_ad_size,原生横幅/插屏可传 video_mute;iOS 原生插屏不支持。
穿山甲(adsource_id=17)primeRitId 填写说明
| 项 | 说明 |
|---|---|
| 创建 | 手动创建(不传 is_auto_create,或为 0)。placement_config 须同时含 非空 appId、placementId、primeRitId。缺 primeRitId 返回 primeRitId广告位配置参数缺失;空串返回 primeRitId广告位配置参数不能为空 |
| 自动化 | 不支持。is_auto_create=1 返回「当前广告网络不支持自动化创建」。系统不会调用穿山甲 prime_rit/create 或代码位创建接口 |
| 查询 | 已存值在 placement_config.primeRitId 回显;老数据没有该键则不返回、不报错 |
| 编辑 | 省略 primeRitId 则保持原值;传新值则更新该条广告源 JSON;空串拒绝。get_placement_list_by_app 不会跨广告位复用 primeRitId(不同曝光场景须用不同物理位) |
primeRitId 从穿山甲国内(csjplatform)后台物理广告位复制,对应创编 API 的 prime_rit_id。
Yandex(adsource_id=50)自动化创建填写说明
| 项 | 说明 |
|---|---|
| 权限 | 公司须开通 Yandex 广告网络权限(HB_YANDEX);未开通时创建返回「当前公司未开通Yandex广告网络权限」,查询广告源列表也会过滤 Yandex |
auto_app_id | is_auto_create=1 时必填,缺失返回「缺少自动化需要的APP ID」 |
placement_config.placementId | 自动化创建时可省略或传空串;系统调用 Yandex adunit API 创建后,以三方返回 id 回写(对齐 Web) |
| 普通激励 | placement_ad_type=0 时 currencyType(奖励名称)、currencyValue(奖励数量)必填;插屏激励(placement_ad_type=2)不要求这两项 |
| 原生横幅 | 可传 is_template_rendering,创建落库并在查询时回显 |
原生横幅(is_native=1)native_ad_size / close_button 填写说明
适用:横幅广告位 + placement_list.is_native=1 + 广告网络为 AdMob(2)、Pangle 海外(19)、Vungle(7)、Mintegral(18)、Inmobi(23)、Yandex(50)、Bigo(57)、zMaticoo(55)、Columbus(76)、TaurusX(74)、Moloco(82)、Google Ad Manager(48)、start.io(28)。字段写在 placement_config 内;查询列表时在 placement_config 回显。
| 字段 | 说明 |
|---|---|
| native_ad_size | 原生横幅尺寸:1-320 x 50、2-320 x 100、3-300 x 250、4-728 x 90;创建时必填。AdMob(2)、Moloco(82)仅允许 3(300 x 250) |
| close_button | 关闭按钮:1-显示、2-隐藏;创建时可省略,默认 2(隐藏) |
Meta 原生拼横幅(is_native=13):仅 Meta 横幅广告位适用。传 is_native=13 表示原生拼横幅,系统固定 is_template_rendering=2(自渲染),同样适用 native_ad_size(必填)与 close_button(可省略,默认 2);不需配置 ad_size、is_template_rendering。创建后查询广告源时 is_native 回显为 13。
Vungle 普通横幅(placement_ad_type=1):横幅广告 位 + is_native=0 + placement_config.placement_ad_type=1 时,同样适用 native_ad_size(必填)与 close_button(可省略,默认 2)。
Google Ad Manager(48)原生横幅:除 native_ad_size、close_button 外,还须 ad_size 素材比例:1 未指定、2 任意尺寸、3 横屏尺寸、4 竖屏尺寸、5 正方形尺寸。缺失返回 ad_size样式配置参数缺失。start.io 原生横幅不填 ad_size。
校验错误:缺失 native_ad_size 返回 native_ad_size 样式配置参数缺失;AdMob、Moloco 传非 3 返回 native_ad_size 配置参数错误(历史尺寸不迁移,编辑未改该字段时保持原值);非 Meta 平台或非横幅广告位使用 is_native=13 返回「广告支持类型参数错误」;非上述平台使用 is_native=1 配置原生横幅尺寸/关闭按钮时,字段不会被 OpenAPI 处理。
内嵌式自适应横幅(is_native=99)填写说明
适用:横幅广告位 + is_native=99 + 广告网络为 AdMob(2)、Google Ad Manager(48)。
| 字段 | 说明 |
|---|---|
| is_native | 传 99,表示内嵌式自适应横幅 |
| placement_config | 按附录 2 填写授权与广告位参数;不需配置 ad_size、collapsible |
创建后不支持修改横幅样式类型。
常见错误:非 AdMob、Google Ad Manager 或非横幅广告位使用 is_native=99,返回「广告支持类型参数错误」;内嵌式自适应横幅传入 ad_size 或 collapsible,返回「内嵌式自适应横幅不支持 ad_size/collapsible」。
2 编辑广告源
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| currency | String | Y | 币种单位 CNY 或 USD | |
| placement_list | Array | Y | 广告源配置 | |
| placement_list.placement_id | String | Y | 广告源 id | |
| placement_list.name | String | N | 广告源名称 | |
| placement_list.api_token_id | Int | N | 网络授权 id | 参考7.1 |
| placement_list.is_auto_price | Int | N | 是否开启自动价格 | 非 Header Bidding 可以修改,1 开启, 2 关闭 |
| placement_list.rate | Int | Float | 排序价格 | 关联 currency, 非 Header Bidding 可以修改 |
| placement_list.placement_config | Json | Y | 广告源参数配置 | 只能修改样式配置;穿山甲(17) 另可改 primeRitId(省略保持,空串拒绝)。is_modify_pid=1 时可改 PID 字段并按后台规则跨广告位同步 |
| placement_list.group_list | Array | N | 中介组开关 | 传入则必须传全量(含空数组)。[] 会关掉该广告源下全部组关系。省略则不改组开关。非空时每项须含 group_id、bucket_id、adseat_id(数字 ID),且必须属于当前广告位。可选:selected(1=该组开启,不传默认 1;0=关闭)、rate(排序价格,不传默认 0,单位与 currency 一致)、is_auto_price(不传默认 0)。对不上会报错、不改库。通过后先全关再按列表恢复;漏传的组会被关掉 |
| placement_list.bidding_floor_price | Float | N | 广告源 Bidding 底价 | 仅 Header Bidding 广告源可写。单位与本次请求 currency 一致。非 ADX 需权限。更新未传则保持原值 |
| placement_list.is_modify_pid | Int | N | 是否同步修改 PID | 1=跨广 告位同步,需 modify_placement 权限。旧 PID 与新 PID 均已被其他广告位占用时返回「广告位下已存在相同广告源参数」 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| data | Array | Y | |
| data.placement_id | Int | Y | 广告源 id |
| data.name | String | Y | 广告源名称 |
| data.placement_config | String | Y | 传入的广告源参数配置 |
| data.error_message | String | Y | 错误信息,没有表示成功 |
请求示例
curl --location --request POST 'https://openapi.tradplusad.com/api/placement/store?sign=5DE008C88087D8556D276A9E5B8E37E6×tamp=1629525680&nonce=5c672d4e9628d0a7' \
--header 'bear: 157E4A5D-3877-1236-DE06-457FT3F70C4' \
--header 'Content-Type: application/json' \
--data '{"currency":"USD","placement_list":[{"name":"API-1\u521b\u5efa\u5e7f\u544a\u6e90","api_token_id":1640,"adsource_id":16,"adseat_uuid":"42D65EDFC13A93B5B25F70FC57280A97","is_header_bidding":0,"is_auto_price":1,"rate":0.03,"placement_config":"{\"placementId\":\"9499192321\",\"appId\":\"53102791\",\"is_template_rendering\":2,\"video_mute\":1,\"auto_play_video\":1,\"video_max_time\":5}","is_bottom":1,"is_native":1}]}'
返回样例:
{
"code": 200,
"status": 0,
"data": [
{
"placement_id": 0,
"name": "test_yky1",
"placement_config": "{ "appId": "zzz", "placementId": "23","video_mute":1 }",
"error_message": "广告源名称重复"
},
{
"placement_id": 859455,
"name": "test_yky2",
"placement_config": "{ "appId": "zzz", "placementId": "23","video_mute":1 }",
"error_message": ""
},
]
}
8 A/B 测试管理
8.1 A/B 测试列表
请求路径: /api/abtest/list
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| abtest_id | Int | N | A/B 测试 ID | 传入后按指定 A/B 测试过滤 |
| adseat_uuid | String | N | 广告位 UUID | 传入后按广告位过滤 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| data | Array | Y | A/B 测试列表 |
| data[].abtest_id | Int | Y | A/B 测试 ID |
| data[].name | String | Y | A/B 测试名称 |
| data[].app_uuid | String | Y | 应用 UUID |
| data[].adseat_uuid | String | Y | 广告位 UUID |
| data[].share_adseat_uuid | String | Y | 共享广告位 UUID |
| data[].status | Int | Y | A/B 测试状态 0-待手动开启 1-指定时间待开启 2-进行中 3-已结束 |
| data[].group_id | String/Int | Y | 分组 ID |
| data[].ab_type | Int | Y | A/B 测试类型(1 广告位 A/B 测试,2 中介组 A/B 测试) |
| data[].start_time | Int | Y | 开始时间(时间戳) |
| data[].end_time | Int | Y | 结束时间(时间戳) |
| data[].is_system | Int | Y | 是否智能托管 |
| data[].reverse | Int | Y | 是否用户反转分流(0/1) |
| data[].auto_hand | Int | Y | 是否手动生效(0/1) |
| data[].available_time | Int | Y | 计划生效时间(时间戳) |
| data[].available_time_zone | String | Y | 生效时区 |
| data[].description | String | Y | 备注 |
| data[].is_bind_share_adseat | Int | Y | 是否绑定共享广告位(0/1) |
| data[].buckets | Array | Y | 分组列表 |
| data[].buckets[].id | Int | Y | 分组 ID |
| data[].buckets[].name | String | Y | 分组名称 |
| data[].buckets[].percent | String/Int | Y | 分流占比 |
| data[].buckets[].weight | Int | Y | 权重 |
| data[].buckets[].ab_status | Int | Y | 分组状态 1-开启 2-暂停 3-结束 |
| data[].buckets[].is_win | Int | Y | 是否获胜分组(0/1)1-获胜组 |
| data[].buckets[].bucket_group_id | Int | Y | 分组组号 |
| data[].buckets[].is_share_bucket | String | Y | 分组是否使用共享广告位(0/1)1为使用 |
请求示例
curl--location'http://openapi.tradplusad.com/api/abtest/list?sign=A33B4508815081F9D41D96E96F7B297E×tamp=1666261328&nonce=5c672d4e9628d0a7'
--header'bear: EEB82554-BD76-1474-EB7E-3785B5107872'
--header'Content-Type: application/json'
--data'{"adseat_uuid":"E6379DA920E44F5DC13A06FCBE09E212"}'
返回样例
{
"code": 200,
"status": 0,
"data": [
{
"name": "ABTest_Modify_20260312",
"status": "2",
"group_id": "0",
"ab_type": "1",
"start_time": "1773395668",
"end_time": "0",
"is_system": "0",
"reverse": "0",
"auto_hand": "1",
"available_time": "0",
"available_time_zone": "8",
"description": "modify by openapi11",
"is_bind_share_adseat": "1",
"abtest_id": "3203",
"app_uuid": "8EFC6E4C26E961B3C68C274CE4862511",
"adseat_uuid": "E6379DA920E44F5DC13A06FCBE09E212",
"share_adseat_uuid": "797A392C56327B804E3547DD76E29812",
"buckets": [
{
"id": "8417",
"name": "C组-新增-更新",
"percent": "1",
"weight": "1",
"ab_status": "2",
"is_win": "0",
"bucket_group_id": "3",
"is_share_bucket": "0"
},
{
"id": "8416",
"name": "B组-更新",
"percent": "45",
"weight": "45",
"ab_status": "1",
"is_win": "0",
"bucket_group_id": "2",
"is_share_bucket": "0"
},
{
"id": "8415",
"name": "A组-更新",
"percent": "55",
"weight": "55",
"ab_status": "1",
"is_win": "0",
"bucket_group_id": "1",
"is_share_bucket": "1"
}
]
}
]
}
8.2 创建 A/B 测试
请求路径: /api/abtest/store
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| name | String | Y | A/B 测试名称 | 最长30字符 |
| ab_type | Int | Y | A/B 测试类型 | 1 广告位 A/B 测试,2 中介组 A/B 测试 |
| app_uuid | String | Y | 应用 ID | |
| adseat_uuid | String | Y | 广告位 ID | 必须与app_uuid匹配 |
| group_id | String/Int | N | 分组 ID | ab_type=2时必传;传0表示所有国家组;不传默认空 |
| auto_hand | Int | Y | 是否手动生效 | 1 手动开启,0 按时间自动开启 |
| available_time | String | N | 生效时间 | auto_hand=0时必传,建议格式:Y-m-d H:i:s |
| available_time_zone | String | N | 时区 | auto_hand=0时必传,可选:-8、0、8 |
| buckets | Array | Y | A/B 分组配置 | 至少2组 |
| buckets[].name | String | Y | 分组名称 | 分组名称不可重复 |
| buckets[].percent | float | Y | 分流占比 | 按业务规则传值 0~100;注:所有分组总和范围在 99~100(容差 1) |
| buckets[].weight | Int | Y | 权重 | 0~100 |
| buckets[].ab_status | Int | Y | 分组状态 | 创建时固定传1(开启) |
| buckets[].copy_group_config | Int | N | 是否复制当前配置 | 1 复制当前配置(推荐);其他值不复制当前配置(首个分组会被强制为1) |
| buckets[].is_share_bucket | Int | N | 分组是否使用共享广告位 | is_bind_share_adseat=1时生效,1为使用 |
| description | String | N | 备注 | 最长100字符 |
| is_bind_share_adseat | Int | N | 是否绑定共享广告位 | 0 否,1 是 |
| share_adseat_uuid | String | N | 共享广告位 ID | is_bind_share_adseat=1时必传 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| abtest_id | Int | Y | A/B 测试 ID |
| name | String | Y | A/B 测试名称 |
请求示例
curl--location'http://openapi.tradplusad.com/api/abtest/store?sign=A33B4508815081F9D41D96E96F7B297E×tamp=1666261328&nonce=5c672d4e9628d0a7'
--header'bear: EEB82554-BD76-1474-EB7E-3785B5107872'
--header'Content-Type: application/json'
--data'{"name":"ABTest_API","ab_type":1,"app_uuid":"8EFC6E4C26E961B3C68C274CE4862511","adseat_uuid":"E6379DA920E44F5DC13A06FCBE09E212","group_id":0,"auto_hand":0,"available_time":"2026-03-12 20:00:00","available_time_zone":"8","description":"openapi create abtest","is_bind_share_adseat":0,"share_adseat_uuid":"","buckets":[{"name":"A组","percent":50,"weight":50,"ab_status":1,"copy_group_config":1,"is_share_bucket":0},{"name":"B组","percent":50,"weight":50,"ab_status":1,"copy_group_config":1,"is_share_bucket":0}] }'
返回样例
成功:
{
"code": 200,
"status": 0,
"data": {
"abtest_id": 12345,
"name": "AB测试_插屏"
}
}
失败:
{
"code": 10002,
"status": 1,
"message": "参数错误"
}
8.3 编辑 A/B 测试
请求路径: /api/abtest/modify
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| abtest_id | Int | Y | A/B 测试 ID | |
| name | String | Y | A/B 测试名称 | 最长30字符 |
| reverse | Int | N | 是否用户反转分流 | 0 否,1 是;仅支持 A/B 测试进行中设置 |
| description | String | N | 备注 | 最长100字符 |
| buckets | Array | Y | A/B 分组配置 | 至少2组 |
| buckets[].id | Int | N | 分组记录 ID | 编辑已有分组时必传(从列表接口中获取);新增分组不传 |
| buckets[].bucket_group_id | Int | N | 分组组号 | 编辑已有分组时必传(从列表接口中获取);新增分组不传或传0 |
| buckets[].name | String | Y | 分组名称 | 不可为空 |
| buckets[].percent | float | Y | 分流占比 | 按业务规则传值 0~100;注:所有分组总和范围在 99~100(容差 1) |
| buckets[].weight | Int | Y | 权重 | 0~100 |
| buckets[].ab_status | Int | Y | 分组状态 | 1 开启,2 暂停 |
| buckets[].is_share_bucket | Int | N | 分组是否使用共享广告位 | is_bind_share_adseat=1时生效,1为使用;仅支持未开启 A/B 测试时修改 |
| buckets[].copy_group_config | Int | N | 是否复制当前配置 | 新增分组时使用:1复制当前配置(推荐),其他值不复制当前配置 |
请求示例
curl--location'http://openapi.tradplusad.com/api/abtest/modify?sign=A33B4508815081F9D41D96E96F7B297E×tamp=1666261328&nonce=5c672d4e9628d0a7'
--header'bear: EEB82554-BD76-1474-EB7E-3785B5107872'
--header'Content-Type: application/json'
--data'{"abtest_id":3203,"name":"ABTest_Modify_20260312","reverse":1,"description":"modify by openapi11","buckets":[{"id":8415,"bucket_group_id":1,"name":"A组-更新","percent":55,"weight":55,"ab_status":1,"is_share_bucket":1},{"id":8416,"bucket_group_id":2,"name":"B组-更新","percent":45,"weight":45,"ab_status":1,"is_share_bucket":0},{"name":"C组-新增","percent":1,"weight":1,"ab_status":1,"copy_group_config":1,"is_share_bucket":0}]}'
返回样例
成功:
{
"code": 200,
"status": 0,
"data": {
"abtest_id": 12345,
"name": "ABTest_Modify"
}
}
失败:
{
"code": 10002,
"status": 1,
"message": "参数错误"
}
8.4 开启 A/B 测试
请求路径: /api/abtest/start
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| abtest_id | Int | Y | A/B 测试 ID | 仅支持开启“待手动开启”状态的 A/B 测试 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| abtest_id | Int | Y | A/B 测试 ID |
| status | Int | Y | A/B 测试状态(0-待手动开启 1-指定时间待开启 2-进行中 3-已结束) |
请求示例
curl--location'http://openapi.tradplusad.com/api/abtest/start?sign=A33B4508815081F9D41D96E96F7B297E×tamp=1666261328&nonce=5c672d4e9628d0a7'
--header'bear: EEB82554-BD76-1474-EB7E-3785B5107872'
--header'Content-Type: application/json'
--data'{"abtest_id":3203}'
返回样例
成功:
{
"code": 200,
"status": 0,
"data": {
"abtest_id": 3208,
"status": 2
}
}
失败:
{
"code": 1001,
"status": 1,
"message": "参数错误"
}
8.5 关闭 A/B 测试
请求路径: /api/abtest/close
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| abtest_id | Int | Y | A/B 测试 ID | |
| bucket_id | Int | N | 胜出分组 ID | 关闭“生效中”AB 测试时必传(用于指定获胜分组) |
| type | Int | N | 关闭类型 | 1 常规关闭,2 智能托管关闭 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| abtest_id | Int | Y | A/B 测试 ID |
| status | Int | Y | A/B 测试状态(0-待手动开启 1-指定时间待开启 2-进行中 3-已结束) |
请求示例
curl--location'http://openapi.tradplusad.com/api/abtest/close?sign=A33B4508815081F9D41D96E96F7B297E×tamp=1666261328&nonce=5c672d4e9628d0a7'
--header'bear: EEB82554-BD76-1474-EB7E-3785B5107872'
--header'Content-Type: application/json'
--data'{"abtest_id":3203,"bucket_id":8431,"type":1}'
返回样例
成功:
{
"code": 200,
"status": 0,
"data": {
"abtest_id": 3208,
"status": 3
}
}
失败:
{
"code": 1001,
"status": 1,
"message": "参数错误"
}
9 查询通用信息
9.1 查询国家信息
请求路径: /api/info/region
请求参数:无
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| list | Array | Y | |
| list.name | String | Y | 中文名 |
| list.name_en | String | Y | 英文名 |
| list.iso | String | Y | 国家二位码(短码) |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"list": [
{
"name": "比利时",
"name_en": "Belgium",
"iso": "BE"
},
{
"name": "利比亚",
"name_en": "Libya",
"iso": "LY"
},
...
]
}
}
9.2 查询城市信息
请求路径: /api/info/city
请求参数:无
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| list | Array | Y | |
| list.id | String | Y | id |
| list.pid | String | Y | 上级 id |
| list.name | String | Y | 城市 |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"list": [
{
"id": "1",
"pid": "0",
"name": "北京市"
},
{
"id": "2",
"pid": "0",
"name": "天津市"
},
...
]
}
}
9.3 广告网络查询
请求路径: /api/info/adsource_list
请求参数:无
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| list | Array | Y | |
| list.name | String | Y | 广告平台名称 |
| list.adsource_id | Int | Y | tradplus 广告平台 id |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"list": [
{
"name": "Meta",
"adsource_id": 1
},
{
"name": "Admob",
"adsource_id": 2
},
...
]
}
}
10 广告场景
10.1 查询广告场景
请求路径: /api/AdScene/scenes
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| app_uuid | String | N | 应用 uuid | |
| adseat_uuid | String | N | 广告位 ID | |
| page | Int | N | 页数 默认1 | 每页100条 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| has_more | Int | Y | 是否还有更多 1 是 0 否 |
| total | Int | Y | 总数量 |
| adscene_list | Array | Y | |
| adscene_list.ad_scene_id | String | Y | 场景主键 ID |
| adscene_list.ad_scenes_name | String | 场景名称 | |
| adscene_list.app_uuid | String | 应用 ID | |
| adscene_list.adseat_uuid | String | 广告位 ID | |
| adscene_list.uuid | String | 场景 uuid | sdk 使用 |
| adscene_list.is_custom_uid | String | 是否使用自定义场景 1 是 0 否 | |
| adscene_list.status | String | 状态 1 启用 2 停用 | |
| adscene_list.remark | String | 备注 |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"has_more": 0,
"total": 1,
"adscene_list": [
{
"ad_scene_id": "260",
"ad_scenes_name": "tab",
"app_uuid": "38C0EB39AC0C015903E5CA6CA069AFF7",
"adseat_uuid": "2A7E2D218A488665581A608D7AC9AA6F",
"uuid": "76BE82DBAE98A3",
"is_custom_uid": "0",
"status": "1",
"remark": ""
}
]
}
}
10.2 创建和编辑广告场景
请求路径: /api/AdScene/store
请求参数:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| adscene_list | Array | Y | 广告场景信息 | |
| adscene_list.adseat_uuid | String | Y | 广告位 ID | |
| adscene_list.ad_scene_id | Int | N | 广告场景主键 id | 编辑必传。对应9.1 ad_scene_id |
| adscene_list.ad_scene_name | String | Y | 场景名称 | |
| adscene_list.status | Int | N | 创建必传。状态 1 启用 2 停用 | |
| adscene_list.remark | String | N | 备注 | |
| adscene_list.is_custom_uid | Int | N | 创建必传。是否使用自定义场景 1 是 0 否 | |
| adscene_list.custom_uid | String | N | 自定义场景 uid | 选择使用自定义场景时必填且不能重复 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| list | Array | Y | |
| list.adseat_uuid | String | N | 应用 ID |
| list.ad_scene_name | String | N | 场景名称 |
| list.ad_scene_id | Int | N | 场景主键 id |
| list.error_message | String | N | 错误信息,空字符表示成功 |
返回样例:
{
"code": 200,
"status": 0,
"data": {
"list": [
{
"adseat_uuid": "2A7E2D218A488665581A608D7AC9AA6F",
"ad_scene_name": "奖励界面",
"ad_scene_id": 125,
"error_message": ""
},
{
"adseat_uuid": "2A7E2D218A488665581A608D7AC9AA6F",
"ad_scene_name": "关卡",
"ad_scene_id": 220,
"error_message": ""
}
]
}
}