开发者后台管理API
修订历史
| 发布时间 | 修订说明 |
|---|---|
| 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、GAM 横幅内嵌式自适应广告源。 |
| 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
登录后台,点击公司名称,进入“我的账号”,“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:已上架 |
请求示例
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
},
{
"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 | 应用商店链接 | 注意:仅ios适用。 如果传了表示应用已经上架,会自动使用上架的app信息。 所以此时app_name,package_name可以不传, 如果传了则会覆盖。 |
| app_list.category_id | Int | N | 分类参考 3.1 获取应用分类 | 创建必传 |
| app_list.direction | Int | N | 屏幕方向 | 1-竖屏 2-横屏 0-自适应 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| 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.cache_num | Int | Y | 并行请求数 | |
| adseat_list.ad_type | Int | Y | 广告类型: 1 原生 2 插屏 3 开屏 4 横幅 5 激励视频 | |
| 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 | 奖励数量 | 激励视频类型返回 |
请求示例
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",
"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",
"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 | 创建必传 开屏范围:1 |
| adseat_list.ad_type | Int | Y | 广告类型: 1 原生 2 插屏 3 开屏 4 横幅 5 激励视频 | 广告类型,创建必传,创建后不可编辑。 |
| 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 | 奖励数量 | 仅对激励视频生效 |
返回字段:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| 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 底价 |
| 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 | 预置中介组国家 |
请求示例
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 底价 | |
| group_list.cache_num | Int | Y | 并行请求数 | 上限为20 |
| 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 |
返回字段:
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| 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、GAM 横幅) |
| 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 见下文填写说明 |
| placement_list.is_native | Int | N | 广告支持类型 | 0 普通、1 原生;仅限横幅、开屏、插屏广告位(横幅:0 普通横幅,1 原生横幅;开屏、插屏同理)。AdMob、GAM 横幅另支持 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、Bigo、TaurusX、Inmobi |
| placement_list.auto_app_id | string | N | 自动化创建顶层 App ID | Meta、Inmobi 自动化必填(is_auto_create=1);AdMob 勿传,应用 ID 填写 placement_config.appId |
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广告位配置参数不能为空。
原生横幅(is_native=1)native_ad_size / close_button 填写说明
适用:横幅广告位 + placement_list.is_native=1 + 广告网络为 AdMob(2)、Meta(1)、Pangle 海外(19)、Vungle(7)、Mintegral(18)、InMobi(23)、Yandex(50)、Bigo(57)、Columbus(76)、TaurusX(74)。字段写在 placement_config 内;查询列表时在 placement_config 回显。
| 字段 | 说明 |
|---|---|
| native_ad_size | 原生横幅尺寸:1-320 x 50、2-320 x 100、3-300 x 250、4-728 x 90;创建时必填 |
| 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)。
校验错误:缺失 native_ad_size 返回 native_ad_size样式配置参数缺失;非 Meta 平台或非横幅广告位使用 is_native=13 返回「广告支持类型参数错误」;非上述平台使用 is_native=1 配置原生横幅尺寸/关闭按钮时,字段不会被 OpenAPI 处理。
内嵌式自适应横幅(is_native=99)填写说明
适用:横幅广告位 + is_native=99 + 广告网络为 AdMob(2)、GAM(48)。
| 字段 | 说明 |
|---|---|
| is_native | 传 99,表示内嵌式自适应横幅 |
| placement_config | 按附录 2 填写授权与广告位参数;不需配置 ad_size、collapsible |
创建后不支持修改横幅样式类型。
常见错误:非 AdMob、GAM 或非横幅广告位使用 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 | 广告源参数配置 | 只能修改样式配置 |
返回字段:
| 字段 | 类型 | 必传 | 说明 |
|---|---|---|---|
| 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": "参数错误"
}