https://api.toponad.net/v1/set_networks
POST
,字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
network_name | String | N | 广告平台账号名称,创建或修改操作不传默认名字为“Default”,注意:同一个广告平台(nw_firm_id)不允许创建相同名称的平台账号 |
nw_firm_id | Int | Y | 广告平台ID,各广告平台ID可查看文档获取:聚合平台概况 |
network_id | Int | N | 广告平台账号ID,修改时传入,创建时不传 |
is_open_report | Int | Y | 是否开通Report API,枚举值说明: 1: 不开通 2: 开通 |
api_version | Int | N | 三方平台Publisher维度参数(即下面的auth_content)版本, 注意: 1.不同的版本有不同的三方参数,枚举具体见附件 2.暂时只有穿山甲平台支持分版本,其他平台可忽略不传,穿山甲不传默认是2 |
auth_content | Object | N | 广告平台Publisher维度参数,注意:无论是否开通报表,有些广告平台相关参数都是必传的,详见附录(三方广告平台详细参数)规范中auth_content列 注意: 1:百度平台默认支持的是公钥模式(暂不支持私钥模式) 2:分api版本的平台主要不同版本传不同参数 |
network_app_info | Array[Object] | N | 广告平台App维度信息列表 |
network_app_info.app_id | String | N | TopOn的应用ID |
network_app_info.app_auth_content | Object | N | 广告平台App维度参数,有些广告平台App维度参数必填,详见附录(三方广告平台详细参数)规范中app_auth_content列 |
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
network_name | String | Y | 广告平台账号名称 |
nw_firm_id | Int | Y | 广告平台ID,各广告平台ID可查看文档获取:聚合平台概况 |
network_id | Int | Y | 广告平台账号ID |
is_open_report | Int | Y | 是否开通Report API,枚举值说明: 1: 不开通 2: 开通 |
auth_content | Object | N | 广告平台Publisher维度参数,详见附录(三方广告平台详细参数)规范中auth_content列 |
network_app_info | Array[Object] | N | 广告平台App维度信息列表 |
network_app_info.app_id | String | N | TopOn的应用ID |
network_app_info.app_auth_content | Object | N | 广告平台App维度参数,详见附录(三方广告平台详细参数)规范中app_auth_content列 |
注意:响应错误时(http响应状态码不是200),部分错误描述如下:
1.“network is report error“:请求参数is_open_report数值错误
2.“network name repeated":同一个广告平台创建相同名字账号错误
3.“network auth_content xxx error”:请求参数auth_content缺失或错误,请检查是否开通报表和附录(三方广告平台详细参数)规范
4.“failed to verify network auth_content”:开通报表时校验三方network参数错误或者三方校验超时,请检查三方network参数是否正确,或者稍后重试
5.“network app_auth_content xxx error”:请求参数network_app_info.app_auth_content缺失或错误,请参考附录(三方广告平台详细参数)规范
6."appid error":参数network_app_info.app_id无效
请求样例:
curl --location --request POST 'https://api.toponad.net/v1/set_networks' \
--header 'X-Up-Key: 877f8ae9c6e9ca82c0===b5fff594c373axxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626161553000' \
--header 'Content-Type: application/json' \
--data-raw '{
"network_name": "Default",
"nw_firm_id": 2,
"network_id": 226,
"is_open_report": 2,
"auth_content": {
"account_id": "pub-1310074477383748",
"oauth_key": "1/CW8VoZRbc5UCscXs3ddTXzwT9LQ71uFUMSE6iEwcRlk"
},
"network_app_info": [
{
"app_id": "a5bc9921f7fdb4",
"app_auth_content": {
"app_id": "ca-app-pub-1310074477383748~6985182465"
}
}
]
}'
返回样例:
{
"network_name": "Default",
"nw_firm_id": 2,
"network_id": 226,
"is_open_report": 2,
"auth_content": {
"account_id": "pub-1310074477383748",
"oauth_key": "1/CW8VoZRbc5UCscXs3ddTXzwT9LQ71uFUMSE6iEwcRlk"
},
"network_app_info": [
{
"app_id": "a5bc9921f7fdb4",
"app_auth_content": {
"app_id": "ca-app-pub-1310074477383748~6985182465"
}
}
]
}
https://api.toponad.net/v1/networks
GET
无
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
- | Array[Object] | Y | 广告平台Publisher、App维度参数信息列表 |
-.network_name | String | Y | 广告平台账号名称 |
-.nw_firm_id | Int | Y | 广告平台ID,各广告平台ID可查看文档获取:聚合平台概况 |
-.nw_firm_name_zh | String | Y | 广告平台中文名 |
-.nw_firm_name_en | String | Y | 广告平台英文名 |
-.network_id | Int | Y | 广告平台账号ID,可通过Api(1)创建广告平台后获取 |
-.is_open_report | Int | Y | 是否开通Report API,枚举值说明: 1: 不开通 2: 开通 |
-.api_version | Int | N | 三方平台Publisher维度参数(即下面的auth_content)版本, 注意: 1.不同的版本有不同的三方参数,枚举具体见附件 2.暂时只有穿山甲平台支持分版本,其他平台可忽略 |
-.auth_content | Object | N | 广告平台Publisher维度参数,详见附录(三方广告平台详细参数)规范中auth_content列 |
-.network_app_info | Array[Object] | N | 广告平台App维度信息列表 注意:同一个应用只能绑定到同一个三方平台的一个账号(即一对一关系),某个应用绑定到某个账号后,暂时不支持解绑,也不支持切换绑定到另一个账号(可在后台切换绑定) |
-.network_app_info.app_id | String | N | TopOn的应用ID |
-.network_app_info.app_auth_content | Object | N | 广告平台App维度参数,详见附录(三方广告平台详细参数)规范中app_auth_content列 |
_.status | Int | N | 应用开启、关闭等状态,枚举说明 1: 关闭 3: 开启 |
请求样例:
curl --location --request GET 'https://api.toponad.net/v1/networks' \
--header 'X-Up-Key: ee609bfc9112c50ca4936fdecc43713e7eaaxxxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626056011000' \
--header 'Content-Type: application/json' \
--data-raw ''
返回样例:
[
{
"network_name": "Default",
"nw_firm_id": 1,
"network_id": 307,
"is_open_report": 2,
"network_app_info": [
{
"app_id": "appid1",
"app_auth_content": {
"app_id": "24234234",
"app_token": "1"
}
}
]
},
{
"network_name": "24523423",
"nw_firm_id": 1,
"network_id": 1418,
"is_open_report": 2,
"network_app_info": [
{
"app_id": "appid2",
"app_auth_content": {
"app_id": "232323",
"app_token": "1"
}
}
]
}
]
https://api.toponad.net/v1/set_custom_network
POST
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
nw_firm_id | Int | N | 广告平台ID,修改操作必传,不传表示创建新的自定义广告平台 |
nw_firm_name | String | N | 广告平台名称,创建或修改操作不传默认名字为“Default” |
network_id | Int | N | 广告平台账号ID,修改操作必传 注意1:如果想在同一个自定义平台继续创建账号,nw_firm_id传指定值即可 注意2:创建平台账号后,在创建广告源之前必须先调用Api(5)绑定到指定应用 |
network_name | String | N | 广告平台账号名称,创建或修改操作不传默认名字为“Default” |
firm_adapters | Array[Object] | N | 广告平台adapter信息列表 |
firm_adapters.platform | int | Y | 客户端系统类型,枚举值说明: 1: Android 2: IOS |
firm_adapters.format | int | Y | 广告样式标识,枚举值说明: 0: native 1: rewarded_video 2: banner 3: interstitial 4: splash |
firm_adapters.adapter | string | N | adapter类名,默认为空 |
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
nw_firm_id | Int | Y | 广告平台ID |
nw_firm_name | String | Y | 广告平台名称 |
network_id | Int | Y | 广告平台账号ID |
network_name | String | Y | 广告平台账号名称 |
firm_adapters | Array[Object] | Y | 广告平台adapter信息列表 |
firm_adapters.platform | int | Y | 客户端系统类型,枚举值说明: 1: Android 2: IOS |
firm_adapters.format | int | Y | 广告样式标识,枚举值说明: 0: native 1: rewarded_video 2: banner 3: interstitial 4: splash |
firm_adapters.adapter | string | N | adapter类名 |
注意:响应错误时(http响应状态码不是200),部分错误描述如下:
1.“network id error“:修改操作时没传network_id或所传network_id无效
2.“network firm name is repeated”:已创建有相同名字的自定义广告平台,不允许重复
3.“invalid firm id”:修改操作时没传nw_firm_id或者nw_firm_id和network_id不匹配
请求样例:
curl --location --request POST 'https://api.toponad.net/v1/set_custom_network' \
--header 'X-Up-Key: 877f8ae9c6e9ca82c0675b5fff594c373axxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626161553000' \
--header 'Content-Type: application/json' \
--data-raw '{
"nw_firm_id": 1000068,
"nw_firm_name": "第555",
"network_id": 33,
"network_name": "默认账号112",
"firm_adapters": [
{
"platform": 1,
"format": 0,
"adapter" : "com.topon"
},
{
"platform": 2,
"format": 1,
"adapter" : "com.topon"
}
]
}'
返回样例:
{
"nw_firm_id": 1000068,
"nw_firm_name": "第555",
"network_id": 33,
"network_name": "默认账号112",
"firm_adapters": [
{
"platform": 1,
"format": 0,
"adapter" : "com.topon"
},
{
"platform": 2,
"format": 1,
"adapter" : "com.topon"
}
]
}
https://api.toponad.net/v1/custom_networks
GET
无
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
_ | Array[Object] | Y | 自定义广告平台Publisher维度信息列表 |
-.nw_firm_id | Int | Y | 广告平台ID |
-.nw_firm_name | String | Y | 广告平台名称 |
-.network_id | Int | Y | 广告平台账号ID,可通过Api(3)创建自定义广告平台后获取 |
-.network_name | String | Y | 广告平台账号名称 |
-.firm_adapters | Array[Object] | Y | 广告平台adapter信息列表 |
-.firm_adapters.platform | int | Y | 客户端系统类型,枚举值说明: 1: Android 2: IOS |
-.firm_adapters.format | int | Y | 广告样式标识,枚举值说明: 0: native 1: rewarded_video 2: banner 3: interstitial 4: splash |
-.firm_adapters.adapter | string | N | adapter类名 |
_.status | Int | N | 应用开启、关闭等状态,枚举说明 1: 关闭 3: 开启 |
请求样例:
curl --location --request GET 'https://api.toponad.net/v1/custom_networks' \
--header 'X-Up-Key: ee609bfc9112c50ca4936fdecc43713e7eaaxxxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626056011000' \
--header 'Content-Type: application/json' \
--data-raw ''
返回样例:
[
{
"nw_firm_id": 1000068,
"nw_firm_name": "第555",
"network_id": 33,
"network_name": "默认账号112",
"firm_adapters": [
{
"platform": 1,
"format": 0,
"adapter" : "com.topon"
},
{
"platform": 2,
"format": 1,
"adapter" : "com.topon"
}
]
},
{
"nw_firm_id": 1000069,
"nw_firm_name": "第555",
"network_id": 33,
"network_name": "默认账号112",
"firm_adapters": [
{
"platform": 1,
"format": 0,
"adapter" : "com.topon"
},
{
"platform": 2,
"format": 1,
"adapter" : "com.topon"
}
]
}
]
https://api.toponad.net/v3/networks/app_auths
POST
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
items | Array[Object] | Y | 绑定关系列表 |
items.network_id | Int | Y | 广告平台账号ID |
items.app_id | String | Y | TopOn应用ID |
items.app_auth_content | Object | Y | 广告平台App维度参数,暂时只支持自定义平台 1.自定义平台:无App维度参数,传{}即可,参考请求样例 |
字段 | 类型 | 是否必传 | 备注 |
---|---|---|---|
items | Array[Object] | N | 错误广告源信息列表,注意: 1. 列表为空,则标识操作成功 2. 列表不为空,则列表标识哪些item校验不通过,所有item(包括校验通过)操作失败 |
items.index | Int | Y | 错误item所在的索引,从0开始 |
items.err_code | Int | Y | 错误码 |
items.err_msg | String | Y | 错误信息 |
请求样例:
curl --location --request POST 'https://api.toponad.net/v3/networks/app_auths' \
--header 'X-Up-Key: 877f8ae9c6e9ca82c0675b5fff594c373axxx' \
--header 'X-Up-Signature: CE12B506DBCD868C2C6F09E08C139CBC' \
--header 'X-Up-Timestamp: 1626161553000' \
--header 'Content-Type: application/json' \
--data-raw '{
"items" : [
{
"network_id" : 28574,
"app_id" : "a644751967e00d",
"app_auth_content": {
}
},
{
"network_id" : 28574,
"app_id" : "a644751f9f034c",
"app_auth_content": {
}
},
{
"network_id" : 28575,
"app_id" : "a644751967e00d",
"app_auth_content": {
}
}
]
}'
返回样例:
{
}