https://openapi.toponad.com/v3/abtest
GET
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
app_ids | Array[string] | N | 应用ID列表,默认所有应用ID,数量最大限制为100 |
placement_ids | Array[string] | N | 广告位ID列表,数量最大限制为100 |
name | string | N | A/B测试名称 |
status | int | N | 状态 1=已结束, 3=测试中,6=待生效 |
start | int | N | 起始偏移量,默认0 |
limit | int | N | 获取个数,默认15,最大一次性获取100 |
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
data | Array[Object] | Y | 返回结果数据 |
data.id | int | Y | A/B测试的ID |
data.app_id | string | Y | 应用ID |
data.name | String | Y | A/B测试的名称 |
data.status | int | Y | 状态 1=已结束, 3=测试中,6=待生效 |
data.start_time_type | int | Y | 开始时间的类型 1=立即生效,2=指定生效时间 |
data.start_time_timezone | int | Y | 时区 -12~12 = 西12区 ~ 东12区 |
data.start_time | int | Y | 开始时间,时间戳 |
data.items | Array[Object] | Y | 实验分组 |
data.items.id | int | Y | 实验分组的ID |
data.items.name | int | Y | 实验分组的名称 |
data.items.traffic_variation | int | Y | 实验分组的权重 |
data.items.enable | bool | Y | 实验分组启用状态 false: 停用, true:启用中 |
data.placement_ids | Array[string] | Y | 测试广告位 |
data.choices | Array[Object] | Y | 从A/B实验中停掉的广告位 |
data.choices.placement_id | string | Y | 广告位ID |
data.choices.item_id | int | Y | 停掉的广告位选择的实验分组ID |
data.choices.item_name | string | Y | 停掉的广告位选择的实验分组名称 |
请求样例:
curl --location --request GET 'https://openapi.toponad.com/v3/abtest?name=test' \
--header 'X-Up-Key: 877f8ae9c6e9ca82c0===b5fff594c373axxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626056011000' \
--header 'Content-Type: application/json' \
--data-raw ''
返回样例:
{
"page_info": {
"total": 2,
"start": 0,
"limit": 15
},
"data": [
{
"id": 5815,
"app_id": "a60f54770a583d",
"name": "adbc",
"status": 3,
"start_time_type": 1,
"start_time_timezone": 8,
"start_time": 1627639246,
"items": [
{
"id": 10000080,
"name": "A\u7ec4",
"traffic_variation": 2,
"enable": false
},
{
"id": 10000081,
"name": "B\u7ec4",
"traffic_variation": 1,
"enable": false
},
{
"id": 10000082,
"name": "C\u7ec4",
"traffic_variation": 1,
"enable": false
}
],
"placement_ids": [
"b60f6e9480e4ba"
],
"choices": [
{
"placement_id": "b60f547a595c75",
"item_id": 10000081,
"item_name": "B\u7ec4"
}
]
},
{
"id": 5814,
"app_id": "a60f54770a583d",
"name": "asbc",
"status": 1,
"start_time_type": 1,
"start_time_timezone": 8,
"start_time": 1627638003,
"items": [
{
"id": 10000077,
"name": "A\u7ec4",
"traffic_variation": 2,
"enable": false
},
{
"id": 10000078,
"name": "B\u7ec4",
"traffic_variation": 1,
"enable": false
},
{
"id": 10000079,
"name": "C\u7ec4",
"traffic_variation": 1,
"enable": false
}
],
"placement_ids": [],
"choices": [
{
"placement_id": "b60f547a595c75",
"item_id": 10000077,
"item_name": "A\u7ec4"
},
{
"placement_id": "b60f6e9480e4ba",
"item_id": 10000077,
"item_name": "A\u7ec4"
}
]
}
]
}
https://openapi.toponad.com/v3/abtest
POST
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
name | string | Y | A/B测试名称 |
app_id | string | Y | 应用ID |
start_time_type | int | Y | 开始时间的类型 1=立即生效,2=指定生效时间 |
start_time_timezone | int | Y | 开始时间的时区 -12~12 = 西12区 ~ 东12区 |
start_time | int | Y | 开始时间,时间戳,立即生效时可以不填 |
placement_ids | Array[String] | Y | 测试广告位, 至少一个 |
items | Array[Object] | Y | 实验分组,至少两组 |
items.name | string | Y | 实验分组的名称 |
items.traffic_variation | int | Y | 实验分组的权重 |
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
id | int | Y | 成功时返回创建的ID,失败时无id |
请求样例:
curl --location --request POST 'https://openapi.toponad.com/v3/abtest' \
--header 'X-Up-Key: 877f8ae9c6e9ca82c0==5b5fff594c373axxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626161553000' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test_1",
"app_id": "a60f54770a583d",
"start_time_type": "1",
"start_time_timezone": "8",
"start_time": "1627639246",
"items": [
{
"name": "AAA",
"traffic_variation": 10,
},
{
"name": "BBB",
"traffic_variation": 10,
},
],
"placement_ids": [
"b60f547a2904f9"
]
}'
返回样例:
{
"id": 5816
}
https://openapi.toponad.com/v3/abtest/:id
PUT
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
id | int | Y | A/B测试ID |
name | string | Y | A/B测试名称 |
start_time_type | int | Y | 开始时间的类型 1=立即生效,2=指定生效时间 |
start_time_timezone | int | Y | 开始时间的时区 -12~12 = 西12区 ~ 东12区 |
start_time | int | Y | 开始时间,时间戳,立即生效时可以不填 |
items | Array[Object] | Y | 实验分组(所有的实验组都需要上报) |
items.id | int | Y | 实验分组的ID |
items.name | string | Y | 实验分组的名称 |
items.traffic_variation | int | Y | 实验分组的权重 |
items.enable | bool | Y | 实验分组启用状态 false: 停用, true:启用中 |
placement_ids | Array[string] | Y | 测试广告位 |
choices | Array[Object] | N | 从A/B实验中停掉的广告位 |
choices.placement_id | string | N | 广告位ID |
choices.item_id | int | N | 停掉的广告位选择的实验分组ID |
choices.item_name | string | N | 停掉的广告位选择的实验分组名称 |
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
id | int | Y |
请求样例:
curl --location --request PUT 'https://openapi.toponad.com/v3/abtest/5810' \
--header 'X-Up-Key: 877f8ae9c6e9ca82c0==5b5fff594c373axxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626161553000' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test_45678",
"start_time_type": "2",
"start_time_timezone": "8",
"start_time": "1627639246",
"items": [
{
"id" : 10000066,
"name": "AAA",
"traffic_variation": 10,
"enable": true
},
{
"id" : 10000067,
"name": "BBB",
"traffic_variation": 10,
"enable": true
},
],
"placement_ids": [
"b60f547a3d8b5d"
]
}'
返回样例:
{
"id": 5810
}
https://openapi.toponad.com/v3/abtest/:id/stop
PUT
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
placement_id | string | Y | 广告位ID |
item_id | int | Y | 停掉的广告位选择的实验分组ID |
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
id | int | Y |
请求样例:
curl --location --request PUT 'https://openapi.toponad.com/v3/abtest/5810/stop' \
--header 'X-Up-Key: 877f8ae9c6e9ca82c0==5b5fff594c373axxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626161553000' \
--header 'Content-Type: application/json' \
--data-raw '{
"choices" : [
{
"placement_id" : "b60f547a3d8b5d",
"item_id" : 10000066,
}
]
}'
返回样例:
{
"id": 5810
}
https://openapi.toponad.com/v3/abtest/:id
GET
无
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
id | int | Y | A/B测试的ID |
name | string | Y | A/B测试名称 |
app_id | string | Y | 应用ID |
status | int | Y | 状态 1=已结束, 3=测试中,6=待生效 |
start_time_type | int | Y | 开始时间的类型 1=立即生效,2=指定生效时间 |
start_time_timezone | int | Y | 开始时间的时区 -12~12 = 西12区 ~ 东12区 |
start_time | int | Y | 开始时间,时间戳 |
items | Array[Object] | Y | 实验分组 |
items.id | int | Y | 实验分组的ID |
items.name | string | Y | 实验分组的名称 |
items.traffic_variation | int | Y | 实验分组的权重 |
items.enable | bool | Y | 实验分组启用状态 false: 停用, true:启用中 |
placement_ids | Array[string] | Y | 测试广告位 |
choices | Array[Object] | Y | 从A/B实验中停掉的广告位 |
choices.placement_id | string | Y | 广告位ID |
choices.item_id | int | Y | 停掉的广告位选择的实验分组ID |
choices.item_name | string | Y | 停掉的广告位选择的实验分组名称 |
请求样例:
url --location --request GET 'https://openapi.toponad.com/v3/abtest/5810' \
--header 'X-Up-Key: 877f8ae9c6e9ca82c0===b5fff594c373axxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626056011000' \
--header 'Content-Type: application/json' \
--data-raw ''
返回样例:
{
"id": 5810,
"name": "test_45678",
"publisher_id": 0,
"app_id": "a60f54770a583d",
"status": 3,
"start_time_type": 1,
"start_time_timezone": 8,
"start_time": 1627635702,
"items": [
{
"id": 10000066,
"name": "AAA",
"traffic_variation": 10,
"enable": false
},
{
"id": 10000067,
"name": "BBB",
"traffic_variation": 10,
"enable": false
}
],
"placement_ids": [
"b60f547a3d8b5d"
],
"choices": [
{
"placement_id": "b60f547a2904f9",
"item_id": 10000066,
"item_name": "AAA"
}
]
}