章鱼预算方 API 对接文档
1. 文档下载
注意事项:
价格加密使用的是 base64 没有用 base64-url-safe 编码因此上报曝光时 get 请求可能会造成+号变成空格 这个需特殊处理一下 将空格改为+号
2. 版本历史
版本 | 日期 | 备注 |
---|---|---|
1.0.0 | 2019-01-28 | 初版 |
2.0.0 | 2019-07-28 | 新增 oaid 等字段标识 |
3.0.0 | 2021-04-1 | 支持 RTB 竞价 |
3.3.0 | 2022-01-17 | 支持 价格宏替换加密 |
3.4.19 | 2023-03-6 | 支持 idfamd5、oaidmd5 等字段标识 |
3.4.20 | 2023-06-15 | 新增 paid 参数 |
3.4.21 | 2024-04-10 | 新增 caid 相关参数 |
3.5.1 | 2024-08-08 | 新增下载类相关参数 |
3.请求参数生成示例
以 json 为示例 转换成 pb 序列化后的格式 并生成文件
import com.googlecode.protobuf.format.JsonFormat;
import com.octopus.bidder.api.openrtb.Zy_Proto;
import java.io.FileOutputStream;
/**
* @author Kari
* @date 2022年10月10日下午3:04
*/
public class Test {
public static void main(String[] args) {
Zy_Proto.Request.Builder request = Zy_Proto.Request.newBuilder();
String jsonFormat ="{\n" +
" \"version\": 2,\n" +
" \"id\": \"oFcXvbXQFyVR19LuKNnR08sZbEiA8N5IwGs63mZC\",\n" +
" \"imp\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"pid\": \"202607310\",\n" +
" \"width\": 720,\n" +
" \"height\": 1280,\n" +
" \"bid_floor\": 0\n" +
" }\n" +
" ],\n" +
" \"device\": {\n" +
" \"ip\": \"223.96.182.139\",\n" +
" \"user_agent\": \"Mozilla%2F5.0%28Linux%3BAndroid10%3BAQM-AL00Build%2FHUAWEIAQM-AL00%3Bwv%29AppleWebKit%2F537.36%28KHTML%2ClikeGecko%29Version%2F4.0Chrome%2F88.0.4324.93MobileSafari%2F537.36\",\n" +
" \"idfa\": \"\",\n" +
" \"imei\": \"\",\n" +
" \"imei_md5\": \"\",\n" +
" \"paid\": \"\",\n" +
" \"mac\": \"94:37:F7:92:A6:1F\",\n" +
" \"mac_md5\": \"\",\n" +
" \"device_type\": 0,\n" +
" \"brand\": \"HUAWEI\",\n" +
" \"model\": \"AQM-AL00\",\n" +
" \"os\": \"Android\",\n" +
" \"osv\": \"10\",\n" +
" \"network\": 1,\n" +
" \"operator\": 0,\n" +
" \"width\": 1080,\n" +
" \"height\": 2198,\n" +
" \"pixel_ratio\": 0,\n" +
" \"geo\": {\n" +
" \"lat\": 0.0,\n" +
" \"lon\": 0.0\n" +
" },\n" +
" \"installed_app\": [\n" +
" \"com.xunmeng.pinduoduo\",\n" +
" \"com.eg.android.AlipayGphone\"\n" +
" ],\n" +
" \"oaid\": \"b7eef53f-67f8-47tf-f7fa-ffe2fef35972\",\n" +
" \"idfa_md5\": \"\",\n" +
" \"android_id\": \"\"\n" +
" },\n" +
" \"app\": {\n" +
" \"package_name\": \"com.saveworry.wifi\",\n" +
" \"app_name\": \"wifishengxin\",\n" +
" \"version\": \"3.4.19\"\n" +
" }\n" +
"}";
try {
JsonFormat.merge(jsonFormat, request);
Zy_Proto.Request rtbRequest = request.build();
rtbRequest.writeTo(System.out);
rtbRequest.writeTo(new FileOutputStream("./zyRequest.txt"));
} catch (Exception e) {
e.printStackTrace();
}
}
}