开发者后台管理API
修订历史
| 发布时间 | 修订说明 |
|---|---|
| 2026-4-14 | 接口功能更新:查询广告源信息增加可选参数 ,创建和编辑中介组 支持默认组的更新操作。 |
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": "广告源错误"
}
]
}
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_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 |
| placement_list.is_native | Int | N | 广告支持类型 | 1 原生 0 普通;仅限横幅广告位、开屏广告位、插屏广告位(横幅广告位添加横幅广告 is_native=0;支持添加原生横幅广告 is_native=1;开屏/插屏同理。不同广告源参数配置参考附录2) |
| placement_list.is_bottom | Int | N | 兜底广告 | 1 是 0 否;开启Header Bidding该字段无效 |
| placement_list.is_auto_create | Int | N | 是否自动化创建 | 1-是 0-否,目前仅支持 Meta、Admob |
| placement_list.auto_app_id | string | N | 自动化创建需要的App ID | 仅限 Meta、Admob平台 |
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": "参数错误"
}
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": ""
}
]
}
}
附录1 Header Bidding
| 广告位类型 | 广告源 |
|---|---|
| 开屏 | 腾讯广告 Vungle Mintegral Inmob Columbus Bigo Yandex Pangle |
| 激励视频 | Sigmob(需要开启权限) 腾讯广告 Meta Vungle Mintegral Inmobi YSO Columbus Bigo Yandex Pangle 穿山甲 |
| 插屏 | Sigmob(需要开启权限) 腾讯广告 Meta Vungle Mintegral Inmobi YSO Columbus Bigo Yandex Pangle 穿山甲 |
| 横幅 | 腾讯广告 Meta Vungle Mintegral Inmobi YSO Columbus Bigo Yandex Pangle 穿山甲 |
| 标准原生 | 腾讯广告 Meta Vungle Mintegral Inmobi Columbus Bigo Yandex Pangle 穿山甲 |
| 原生横幅 | 腾讯广告 Meta Vungle Mintegral Inmobi Columbus Bigo Yandex Pangle 穿山甲 |
| Draw信息流 | 腾讯广告 |
| 原生开屏 | 腾讯广告 Vungle Mintegral Inmobi Columbus Bigo Yandex Pangle 穿山甲 |
附录2 广告网络对应广告位类型配置对照表
| 广告网络id | 广告网络名称 | 广告位参数配置 | 广告类型 | 广告样式参数配置 | 备注 |
|---|---|---|---|---|---|
| 1 | Meta | placementId (Placement ID) | 激励视频 | adsource_type 广告位类型 1-激励视频 2-奖励式插屏 | |
| 插屏 | - 无 | 创建 Reels Ads 类型时,is_native传1 | |||
| 开屏 | is_template_rendering 模板类型 2:自渲染 | ||||
| 横幅 | ad_size 广告源尺寸/高度 | 尺寸: | |||
| 标准原生 | is_template_rendering 模板类型 1:模板渲染 2:自渲染 | 高度: | |||
| 原生横幅 | is_template_rendering 模板类型 1:模板渲染 2:自渲染 | ||||
| 2 | AdMob | placementId (广告单元ID) | 激励视频 | adsource_type 广告位类型 1-激励视频广告 2-插页式激励广告 | 当placement_ad_type=2【插屏激励】时,无adsource_type样式 |
| 插屏 | - 无 | ||||
| 横幅 | ad_size 广告源尺寸 | 1: 320 x 50 | |||
| 开屏 | placement_ad_type 广告类型 0-普通开屏 2-插屏开屏 | ||||
| 标准原生 | ad_size 素材比例 | 1: 未指定 | |||
| 原生横幅 | - 无 | ||||
| 5 | Unity Ads | appId (应用 ID) placementId (广告位 ID) | 激励视频 | - | |
| 插屏 | - | ||||
| 开屏 | 不支持 | ||||
| 标准原生 | 不支持 | ||||
| 横幅 | ad_size 广告源尺寸 | ad_size: | |||
| 7 | Vungle | appId (App ID) placementId (广告位置参考ID) | 激励视频 | video_mute 视频静音 1 是 2否 | IOS应用无direction样式; |
| 插屏 | video_mute 视频静音 1 是 2否 | 当is_native=0[普通插屏]时,安卓应用有direction样式,IOS应用无此样式; | |||
| 横幅 | is_template_rendering 广告位类型 0-横幅广告 1-中矩形横幅广告 | ad_size: | |||
| 开屏 | video_mute 视频静音 1 是 2否 | 当is_native=0[普通开屏]时,placement_ad_type=0 安卓应用仅有direction样式且值只有1,2,IOS应用无样式; | |||
| 标准原生 | is_template_rendering 广告类型 1-中矩形横幅广告 2-标准原生 3-Inline | 当is_template_rendering=3时,ad_size样式 | |||
| 15 | Chartboost | appSign (App Signature) appId (App ID) placementId (Location) | 激励视频 | - 无 | |
| 插屏 | - 无 | ||||
| 横幅 | ad_size 广告源尺寸 | ad_size: | |||
| 开屏 | 不支持 | ||||
| 标准原生 | 不支持 | ||||
| 16 | 腾讯广告 | appId (Media ID) placementId (Unit ID) | 激励视频 | video_mute 视频静音 1 是 2否 | |
| 插屏 | full_screen_video 是否全屏 1 是 2否 | 不限时长: video_max_time -1 | |||
| 横幅 | is_template_rendering 模板类型 1 优量汇渲染 | ||||
| 开屏 | zoom_out 开屏V+ 1 是 2 否 | ||||
| 标准原生 | is_template_rendering 1 优量汇渲染 2 开发者自渲染 4 贴片视频广告(优量汇渲染) 5 贴片视频广告(自渲染) | ||||
| 原生横幅 | is_template_rendering 2 开发者自渲染 5 贴片视频广告(自渲染) | ||||
| Draw信息流 | - 无 | ||||
| 原生开屏 | is_template_rendering 2 开发者自渲染 3 优量汇渲染
video_mute 视频静音 1 是 2否 | ||||
| 17 | 穿山甲 | appId (App ID) placementId (Slot ID) | 激励视频 | app_download_setup 广告位类型,下载前弹框确认 0 默认 1指定 (仅安卓) | app_download_setup为0时,popconfirm无效 (下同) |
| 插屏 | adsource_type 广告位类型, 1 全屏视频 2插屏广告 3 新插屏广告 | 注意: 1) adsource_type为1时,无ad_size_ratio,video_orientation 2) adsource_type为2时,is_template_rendering固定传1,且无video_orientation 3) adsource_type为3时,无ad_size_ratio,is_template_rendering | |||
| 横幅 | app_download_setup 广告位类型,下载前弹框确认 0 默认 1指定 (仅安卓) popconfirm 二次弹窗确认 1是 2否 (仅安卓) ad_size 1,2,3,4,5,6,7,8 | 1: 600 x 300 | |||
| 开屏 | is_template_rendering 模板类型 1 模板渲染(个性化模板) 2 自渲染 | ||||
| 标准原生 | is_template_rendering 模板类型 1 模板渲染(个性化模板) 2 自渲染 3 贴片视频广告 | ||||
| Draw信息流 | - | ||||
| 原生开屏 | is_template_rendering 模板类型 1 模板渲染(个性化模板) 2 自渲染 | ||||
| 18 | Mintegral | AppKey (App Key) appId (App ID) placementId (Location) unitId (AD Unit ID) | 激励视频 | video_mute 视频静音 1 是 2否 | |
| 插屏 | video_mute 视频静音 1 是 2否 | 创建原生插屏时,需要adsource_type样式 | |||
| 横幅 | is_template_rendering 模板类型 2 自渲染 | ad_size: | |||
| 开屏 | is_skipable 是否 可跳过 1 是 2否【普通开屏】 | 当is_native=0【普通开屏】时,仅有is_skipable、direction、countdown_time、placement_ad_type样式,如果是bidding源即is_header_bidding=1时,则需要传ad_size样式;当 is_native=1【原生开屏】时,仅有placement_ad_type、is_template_rendering、video_mute、auto_play_video样式,当is_native=0 placement_ad_type=2【插屏开屏】时,仅有placement_ad_type、video_mute样式 | |||
| 标准原生 | is_template_rendering 模板类型 1 自动渲染 2 自定义渲染 | is_template_rendering=2时,仅有video_mute样式 | |||
| 19 | Pangle | appId (App ID) placementId (Slot ID) | 激励视频 | is_template_rendering 模板类型 1-模板渲染 | 当placement_ad_type=2【插屏激励】时,无is_template_rendering样式 |
| 插屏 | adsource_type 广告位类型 1 全屏视频 2半屏插屏 | 当is_native=1【原生插屏】时,仅有adsource_type样式 | |||
| 横幅 | is_template_rendering 模板类型 2-自渲染 | ad_size: | |||
| 开屏 | placement_ad_type 广告类型 0 普通开屏 2插屏开屏 | 当is_native=0时,仅有placement_ad_type样式 | |||
| 标准原生 | is_template_rendering 模板类型 2-自渲染 | ||||
| 20 | 快手 | appId (应用 ID) appName(应用名称) placementId (广告位 ID) | 激励视频 | direction 屏幕方向 1 竖屏 2横屏 3 自适应 | |
| 插屏 | adsource_type 广告位类型, 1 全屏视频 2插屏广告 | 仅adsource_type为1全屏视频时 direction屏幕方向可选 | |||
| 开屏 | - | ||||
| 标准原生 | is_template_rendering 模板类型 1 模板渲染 2 自渲染 | ||||
| 原生横幅 | is_template_rendering 模板类型 2 自渲染 | ||||
| Draw信息流 | - | ||||
| 原生开屏 | is_template_rendering 模板类型 1 模板渲染 2 自渲染 | ||||
| 21 | Sigmob | appId (应用 ID) AppKey (App Key) placementId (广告单元 ID) | 激励视频 | ||
| 插屏 | - | ||||
| 开屏 | - | ||||
| 标准原生 | - | ||||
| 原生横幅 | - | ||||
| 原生开屏 | - | ||||
| 23 | Inmobi | placementId (广告位 ID) | 激励视频 | placement_ad_type 激励类型 0-普通激励 2-插屏激励 | |
| 插屏 | adsource_type 广告样式 1-全屏插屏 2-半屏插屏 | 当is_native=1【原生插屏】时,仅有adsource_type样式 | |||
| 开屏 | placement_ad_type 开屏类型 1-原生开屏 2-插屏开屏 | ||||
| 标准原生 | banner_mrec 广告位类型 1-标准原生 4-MREC(300x250) | ||||
| 横幅 | ad_size 广告源尺寸 | ad_size: 1: 320x50 2: 300x250 当is_native=1【原生横幅】时,无ad_size样式 | |||
| 24 | Fyber | appId (应用 ID) placementId (广告位 ID) | 激励视频 | - | |
| 插屏 | video_mute 视频静音 1 是 2否 | ||||
| 开屏 | video_mute 视频静音 1 是 2否 | ||||
| 标准原生 | 不支持 | ||||
| 横幅 | - | ||||
| 40 | TradPlus Adx | placementId (广告位 ID) | 激励视频 | video_mute 视频静音 1-是 2-否 | 当 adsource_type=1时, 无skip_time样式 |
| 插屏 | video_mute 视频静音 1-是 2-否 | 当 adsource_type=2时, 无video_mute样式 | |||
| 开屏 | - | ||||
| 插播 | - | ||||
| 标准原生 | template_render_type 模板类型 | 1-左图右文 2-左文右图 3-上图下文 4-上文下图 5-三图 | |||
| 横幅 | ad_size 广告源尺寸 | ad_size: 1: 横幅(320x50) 2: 大横幅(320x90) 3: 中距形横幅(300x250) 4: 首页横幅(728x90) 100: 自定义 当ad_size=100 ,需传width、height样式 | |||
| 43 | 百度联盟 | appId (APP ID) placementId (Ad Place ID) | 激励视频 | - | |
| 插屏 | adsource_type 广告位类型, 1 全屏视频 3 新模板插屏 | ||||
| 横幅 | is_native=0 不支持 | ||||
| 开屏 | - | ||||
| 标准原生 | is_template_rendering 模板类型 模板类型 1 智能优选 2 自渲染 | ||||
| 原生横幅 | is_template_rendering 模板类型 模板类型 2 自渲染 | ||||
| 原生开屏 | is_template_rendering 模板类型 模板类型 1 智能优选 2 自渲染 | ||||
| 44 | 游可赢 | appId (应用 ID) placementId (广告位 ID) | 激励视频 | video_mute 视频静音 1 是 2否 | |
| 插屏 | - | ||||
| 开屏 | - | ||||
| 标准原生 | is_template_rendering 模板类型 2 自渲染 | ||||
| 原生开屏 | is_template_rendering 模板类型 2 自渲染 | ||||
| 50 | Yandex | placementId (Ad Unit ID) | 激励视频 | placement_ad_type 激励类型 0-普通激励 2-插屏激励 | |
| 插屏 | adsource_type 广告样式 1-全屏视频 2-半屏插屏 | 当is_native=0【普通插屏】时,无样式 | |||
| 开屏 | placement_ad_type 开屏类型 0-普通开屏 1-原生开屏 2-插屏开屏 | ||||
| 标准原生 | is_template_rendering 模板类型 1-模版渲染 2-自渲染 | ||||
| 横幅 | ad_size 广告源尺寸 | ad_size: | |||
| 57 | Bigo | appId (应用 ID) placementId (广告位 ID) | 激励视频 | placement_ad_type 0-普通激励 2-插屏激励 | 当创建【插屏激励】时,仅有placement_ad_type=2样式 |
| 插屏 | adsource_type 广告位类型 1-全屏视频 2-半屏插屏 | 当is_native=0【普通插屏】时,无样式 | |||
| 开屏 | adsource_type 广告位类型 1-半屏广告 2-全屏广告 | 当is_native=0【普通开屏】时,仅有adsource_type样式 | |||
| 标准原生 | - | ||||
| 横幅 | ad_size 广告源尺寸 | ad_size: | |||
| 76 | Columbus | appKey (App Key) appSecret (App Secret) placementId (Placement ID) | 激励视频 | placement_ad_type 激励类型 0 普通激励 2 插屏激励 | IOS应用不支持创建 |
| 插屏 | adsource_type 广告样式 1 全屏插屏 2 半屏插屏 | 当is_native=0[普通插屏]时,无adsource_type样式 | |||
| 横幅 | ad_size 广告源尺寸 | ad_size: | |||
| 开屏 | placement_ad_type 1原生开屏 2 插屏开屏 | 当is_native=1[原生开屏]时,placement_ad_type=1 | |||
| 标准原生 | - 无 | ||||
| 77 | Yso | placementId (广告位 ID) | 激励视频 | - | |
| 插屏 | - | ||||
| 开屏 | - | ||||
| 标准原生 | - | ||||
| 横幅 | - |
附录3 流量分组规则数据格式
| 字段 | 类型 | 必传 | 说明 | 备注 |
|---|---|---|---|---|
| rules | Array[Object] | Y | 流量分组规则信息列表 | |
| rules.name | string | Y | 名称 | 网络连接类型 device_contype 应用版本 app_ver 设备类型 device_type 设备制造商 device_mak 星期 week 时段 time 年龄 user_age 性别 user_gender SDK版本 sdk_ver 系统版本 device_osv 手机运行内存(RAM) device_ram CPU架构 device_cpu 游戏中等级 user_level 应用内付费金额 user_iap_amount 应用内付费币种 user_iap_currency 应用内付费次数 user_iap_count 渠道 channel 子渠道 sub_channel 自定义用户ID user_id 设备ID device_idfa IDFA 授权 device_idfa_auth Segment Tag segment_tag 应用安装时间 app_instimespan 自定义用户属性 user_custom |
| rules.type | string | Y | 类型 | int,float,version,complex |
| rules.op | string | Y | 操作符 | in,notIn,大于,小于,大于等于,小于等于,=,range |
| rules.data | string | Y | 内容 | 网络连接类型 WiFi(2),5G(7),4G(6),3G(5),2G(4) 设备类型 1-Phone,2-Pad 设备制造商 Apple,Acer,Advan,Amazon,Asus,Blackshark,Coolpad,GIONEE,Google,Hisense,Honor,HTC,Huawei,Infinix,Lanix,LeEco,Lenovo,LGE,Meitu,Meizu,MetroPCS,Motorola,Nokia,Nubia,OnePlus,OPPO,Qcom,Realme,Redmi,Samsung,Sharp,Smartfren,Smartisan,Sony,TCL,Tecno,Verizon,Vivo,Xiaomi,ZTE,360 星期 1-7(代码中动态生成,对应周一到周日) 性别 male(男),female(女) 应用内付费币种 USD,CNY,EUR IDFA 授权 1 authorized,2 unauthorized |
| timezoneOffset | string | Y | 时区 | 使用特殊时区选择组件,自动获取当前时区偏移量 |