BaseUrl: http://api-pre.heyqiwu.cn ##### 获取启动页广告配置 URL: {BaseUrl}:18082/api/ad/v2/interactnovel/config/page/start?uid={用户ID} Method: GET Headers: | key | value| | :----------- | :------------ | | Content-Type | application/json;charset=utf-8 | | App-Channel-Id | 必填 | ResponseBody: ``` SUCCESS: { "code": 1, "msg": "成功", "data": { "configs": [ { "id": "ad11", // String 配置ID  "adAppId": "5287243", // String 广告平台应用ID "adPlatformId": "csjplatform", // String 广告平台ID "adId": "887778092", // String 广告ID "showTime": "6000", // String 单位ms 展示时间 "fullScreen": 1, // Integer 是否全屏, 0:否, 1:是 "open": 1, // Integer 兼容之前的可以忽略 "selectProbability": 30, // Number 选择的机率 "priority": 29, // Integer 优先级 "maxShowTimes": -1, // 最大展示次数, -1表示不限制 "ecpm": 0, // 确认广告的单价, 默认0, 整数 }, { "id": "ad12", "adAppId": "1200336731", "adPlatformId": "qqadnet", "adId": "4082969258400605", "showTime": "6000", "fullScreen": 1, "open": 1, "selectProbability": 30, "priority": 30, "maxShowTimes": -1, "ecpm": 0, } ], "open": 1 // 是否开启启动页广告 } } ``` Example: ``` curl --location --request GET 'http://api-pre.heyqiwu.cn:18082/api/ad/v2/interactnovel/config/page/start?uid=112' \ --header 'App-Channel-Id: tongyong-phone-mobileapp-test1' ``` ##### 获取标签页广告配置 URL: {BaseUrl}:18082/api/ad/v2/interactnovel/config/page/labelType?uid={用户ID} Method: GET Headers: | key | value| | :----------- | :------------ | | Content-Type | application/json;charset=utf-8 | | App-Channel-Id | 必填 | ResponseBody: ``` SUCCESS: { "code": 1, "msg": "成功", "data": { "configs": [ { "id": "ad21", // String 广告配置ID "adAppId": "5287243", // String 广告平台应用ID "adPlatformId": "csjplatform", // String 广告平台ID "adId": "948592277", // String 广告ID "labelType": "推荐", // String 标签类型名称 "position": 3, // Integer 广告挂载的位置 "open": 1, // Integer 兼容之前的可以忽略 "selectProbability": 30, // Number 选择的机率 "priority": 29, // 优先级 "maxShowTimes": -1, // 最大展示次数, -1表示不限制 "ecpm": 0, // 确认广告的单价, 默认0, 整数 }, { "id": "ad22", "adAppId": "1200336731", "adPlatformId": "qqadnet", "adId": "6013913807505049", "labelType": "古风", "position": 6, "open": 1, "selectProbability": 30, "priority": 30, "maxShowTimes": -1, "ecpm": 0, } ], "open": 1 } } ``` Example: ``` curl --location --request GET 'http://api-pre.heyqiwu.cn:18082/api/ad/v2/interactnovel/config/page/labelType?uid=112' \ --header 'App-Channel-Id: tongyong-phone-mobileapp-test1' ``` ##### 获取对话页面广告配置 URL: {BaseUrl}:18082/api/ad/v2/interactnovel/config/page/workDia?workName={作品名称}&uid={用户ID} Method: GET Headers: | key | value| | :----------- | :------------ | | Content-Type | application/json;charset=utf-8 | | App-Channel-Id | 必填 | ResponseBody: ``` { "code": 1, "msg": "成功", "data": { "infoStream": { // 信息流广告 "configs": [ { "id": "ad31", // String 广告配置ID "adId": "948592277", // String 广告ID "adAppId": "5287243", // String 广告平台应用ID "adPlatformId": "csjplatform", // String 广告平台ID "selectProbability": 30, // Number 选择的机率 "priority": 29, // Integer 优先级 "maxShowTimes": -1, // 最大展示次数, -1表示不限制 "ecpm": 0, // 确认广告的单价, 默认0, 整数 }, { "id": "ad32", "adId": "6013913807505049", "adAppId": "1200336731", "adPlatformId": "qqadnet", "selectProbability": 30, "priority": 30, "maxShowTimes": -1, "ecpm": 0, }, { "id": "ad41", "adId": "948592277", "adAppId": "5287243", "adPlatformId": "csjplatform", "selectProbability": 30, "priority": 29, "maxShowTimes": -1, "ecpm": 0, }, { "id": "ad42", "adId": "6013913807505049", "adAppId": "1200336731", "adPlatformId": "qqadnet", "selectProbability": 30, "priority": 30, "maxShowTimes": -1, "ecpm": 0, } ], "showTimeInterval": "10000", // String 切换时间 "cmdAd": 0, // Integer 0: 使用后端给进来的时间进行倒计时刷新; 1:根据对话中出现的广告指令进行刷新; 2: 每轮asr识别完成之后进行刷新。 默认是2 "open": 1 }, "interstitial": { // 插屏广告 "configs": [ { "id": "ad51", // String 广告配置ID "adId": "948652411", // String 广告ID "adAppId": "5287243", // String 广告平台应用ID "adPlatformId": "csjplatform", // String 广告平台ID "suitation": "open-work-after", // String 时机; open-work-before: 打开作品前,open-work-after: 打开作品后 "priority": 29, // Integer 优先级 "probability": 20, // Integer 概率,范围 0~100 "selectProbability": 30, // Number 选择的机率 "open": 1, // Integer 兼容之前的参数可以忽略 "maxShowTimes": -1, // 最大展示次数, -1表示不限制 "ecpm": 0, // 确认广告的单价, 默认0, 整数 }, { "id": "ad52", "adId": "8053630546445146", "adAppId": "1200336731", "adPlatformId": "qqadnet", "suitation": "open-work-before", "probability": 20, "selectProbability": 30, "priority": 30, "open": 1, "maxShowTimes": -1 "ecpm": 0, } ], "open": 1 }, "botTrigger": { "configs": [ { "id": null, // String 广告配置ID "adId": "10000003", // String 广告ID "adAppId": "10000001", // String 广告平台应用ID "adPlatformId": "qiwuadplatform", // String 广告平台ID "priority": 29, // Integer 优先级 "probability": 0, // Integer 概率,范围 0~100 "selectProbability": 100, // Number 选择的机率 "maxShowTimes": -1, // 最大展示次数, -1表示不限制 "ecpm": 0 // 确认广告的单价, 默认0, 整数 } ], "open": 1 } } } ``` Example: ``` curl --location --request GET 'http://api-pre.heyqiwu.cn:18082/api/ad/interactnovel/config/page/workDia?workName=%E5%B0%8F%E7%8B%97%E5%B0%8F%E7%99%BD' \ --header 'App-Channel-Id: tongyong-phone-mobileapp-test1' ``` ##### 获取广告详情 URL: {BaseUrl}:18082/api/ad/v2/interactnovel/config/detail?adPlatfromId={广告平台ID}&appId={应用ID}&appAdId={广告ID}&materialId={素材ID可为空} Method: GET Headers: | key | value| | :----------- | :------------ | | Content-Type | application/json;charset=utf-8 | | App-Channel-Id | 必填 | ResponseBody: ``` { "code": 1, "msg": "成功", "data": { "jumpDeeplink": "", // 跳转的深度链接 "mediaUrl": "http://hw-gz24.heyqiwu.cn/media/mp-asst/adv2/img/0726-1.gif", // 媒体链接 "ecpm": 140, // 广告单价 "appId": "00000000000001", // 广告应用ID "name": "广告详情测试", // 广告的名称 "description": "进峰测试广告描述", // 广告的描述 "mediaType": "img", // 媒体类型-> 图片: img, 视频:video, 音频: audio "appAdId": "00000000000001", // 广告ID "title": "进峰测试广告标题", // 广告标题 "adPlatformId": "qiwuadplatform", // 广告平台ID "materialId": "10000001_0", // 素材ID "jumpUrl": "https://game.adtianshi.cn/index/entry?appkey=367A7DBB6E3CA6ADAF45EA95AF70B625&protocol=https" // 跳转h5地址 } } ``` Example: ``` curl --location --request GET 'api-pre.heyqiwu.cn:18082/api/ad/v2/interactnovel/config/detail?adPlatfromId=qiwuadplatform&appId=10000001&appAdId=10000001&materialId=10000001_0' \ --header 'App-Channel-Id: tongyong-phone-mobileapp-test1' ``` ##### 广告反馈记录 URL: {BaseUrl}:18082/api/ad/v2/show/record METHOD: POST Headers: | key | value| | :----------- | :------------ | | Content-Type | application/json;charset=utf-8 | | App-Channel-Id | 必填 | RequestBody: ``` { "uid":"0", // String 唯一ID "adId":"ad1", // String 广告配置ID "showTimeInterval": 3000, // Long *ms 广告展示了多久 "manualClose": true, // Boolean 是否是手动关闭 } ``` responseBody: ``` SUCCESS: { "code": 1, "msg": "成功", "data": null } FAILTURE { "code": 50002, "msg": "数据有误", "data": null } ``` ##### 获取控制点广告的状态 URL: {BaseUrl}:18082/api/ad/v2/status Method: GET Headers: | key | value| | :----------- | :------------ | | Content-Type | application/json;charset=utf-8 | | App-Channel-Id | 必填 | | ApiToken | 必填 | RequestParams: | 字段 | 描述| | :----------- | :------------ | | uid | 用户ID, 必填 | | controlId | 控制点ID, 必填 | ResponseBody: ``` SUCCESS: { "code": 1, "data": { "status":1 // 1:表示广告已经看完; 0: 表示没有 }, "msg": "成功" } ``` 通过分发接口调用示例 Example: ``` curl --location --request POST 'http://api-pre.heyqiwu.cn:18082/api/dispatch' \ --header 'App-Channel-Id: tongyong-phone-mobileapp-test1' \ --header 'ApiToken: test token' \ --header 'Content-Type: application/json' \ --data-raw '{ "path":"/api/ad/v2/status", "method":"GET", "params":"{\"uid\":\"123\",\"controlId\":\"1231\"}", "body":"" }' ``` ##### 广告展示完成回调接口 URL: {BaseUrl}:18082/api/ad/v2/callback/status Method: POST Headers: | key | description | | :----------- | :------------ | | Content-Type | application/json;charset=utf-8 | | Timestamp | 请求时的时间戳,毫秒级 | | Authorization | 签名, 将 appSecret+":"+timestamp 字符串md5提取摘要 | | App-Channel-Id | 渠道ID | RequestParams: | 字段 | 描述| | :----------- | :------------ | | uid | 用户ID, 必填 | RequestBody: ``` { "controlId":"changweiba2", // 控制点ID "status": 1, // 状态, 0: 表示失败 1: 表示成功 "workName":"长尾巴兔子", // 作品名 "channelId":"xtcv1-watch-sdk-test" // 渠道ID } ``` ResponseBody: ``` SUCCESS: { "code": 1, "data": null "msg": "成功" } ``` Example: ``` curl --location --request POST 'http://api-pre.heyqiwu.cn:18082/api/ad/v2/callback/status?uid=6125f09aa02e9100014eaf57' \ --header 'App-Channel-Id: jiaoyoutianxia-test' \ --header 'Timestamp: 1658458063134' \ --header 'Authorization: a4bf2d13b655364c5250c1ab722fd6f8' \ --header 'Content-Type: application/json' \ --data-raw '{ "controlId":"changweiba2", "status": 1, "workName":"长尾巴兔子", "channelId":"xtcv1-watch-sdk-test" }' ``` ##### 获取激励广告配置 URL: {BaseUrl}:18082/api/ad/v2/interactnovel/config/encourage?uid={用户ID} Method: GET Headers: | key | value| | :----------- | :------------ | | Content-Type | application/json;charset=utf-8 | | App-Channel-Id | 必填 | | App-Version | 必填 | ResponseBody: ``` { "code": 1, "msg": "成功", "data": { "encourageAd": { // 激励广告 "configs": [ // 配置列表 { "id": null, // String 广告配置ID "adId": "test1243", // String 广告ID "adAppId": "s2342", // String 广告平台应用ID "adPlatformId": "werwer", // String 广告平台ID "priority": 23, // Integer 优先级 "selectProbability": 23, // Number 选择的机率 "maxShowTimes": 1, // 最大展示次数, -1表示不限制 "ecpm": 0 // 确认广告的单价, 默认0, 整数 } ], "screenLimits": 60, // 未知参数,之前接口有 "showTimeInterval": "10", // String 切换时间 单位 ms "open": 1 // 是否开启 1: 开启, 0: 关闭 } } } ``` Example: ``` curl --location --request GET 'http://api-pre.heyqiwu.cn:18082/api/ad/v2/interactnovel/config/encourage?uid=123' \ --header 'App-Channel-Id: tongyong-phone-mobileapp-test' \ --header 'App-Version: 2.2.2' ``` Dispatch-Example ``` curl --location --request POST 'http://api-pre.heyqiwu.cn:18082/api/dispatch' \ --header 'App-Channel-Id: tongyong-phone-mobileapp-test' \ --header 'App-Version: 2.2.2' \ --header 'Content-Type: application/json' \ --data-raw '{ "path":"/api/ad/v2/interactnovel/config/encourage", "method":"GET", "params":"{\"uid\":\"123\"}", "body":"" }' ```