广告主对接文档
法律声明
我方签订合同后,我方提供对接协议作为指引文档。未经我方书面许可,不得以任何形式向第三方披露、泄露有关本文档的任何内容。
文档说明
本文档用于消耗方对接我方系统。我方发送流量给消耗方。
修订历史
| 文档版本 | 修订日期 | 修订描述 |
|---|---|---|
| 1.0.0 | 2023-12-01 | 初版 |
| 1.1.0 | 2024-08-01 | 支持protobuf |
| 1.2.0 | 2025-01-16 | 支持loss notice |
| 1.2.1 | 2025-12-10 | 更新Protobuf |
| 1.2.2 | 2026-06-01 | 更新Protobuf, 支持DP失败回传 |
| 1.3.0 | 2026-10-15 | 更新宏替换说明 |
[TOC]
参数定义
HTTP 请求方法
设置HTTP Method 为 POST。
HTTP 请求头
已升级为protobuf,请使用protobuf对接,请到资源页下载
设置Content-type为application/x-protobuf
要求系统支持长链接keepalive
支持gzip,请求头 Content-Encoding:gzip Accept-Encoding:gzip
示例:
POST /bid path HTTP/1.1
HOST: host
Content-Type: application/x-protobuf
Content-Length: length
Connection: Keep-Alive
1 请求
1.1 请求参数
请求参数详见下表:
| 字段 | 必须 | 类型 | 描述 |
|---|---|---|---|
| id | Y | string | 请求唯一标识 |
| imp | Y | [Imp](#1.1.2 Imp) | 广告位信息 |
| device | Y | [Device](#1.1.1 Device) | 设备信息 |
| app | Y | [App](#1.1.3 APP) | 应用信息 |
| user | N | [User](#1.1.4 User) | 用户信息 |
| site | N | [Site](#1.1.2.2 Size) | 站点信息 |
| timeout | N | int | 超时时间(毫秒) |
| debug | N | bool | 测试模式,默认false |
| secure | N | int | 是否只支持https:0-无要求,http和https都支持;1-只支持https |
1.1.1 Device
| 字段 | 类型 | 必须 | 描述 |
|---|---|---|---|
| ip | string | Y | 客户端IP,优先IPv4 |
| ua | string | N | 客户端webview User-Agent |
| devicetype | int | N | 设备类型:0 未知; 1 手机; 2 平板; 4 互联网电视 |
| h | int | N | 屏幕高 |
| w | int | N | 屏幕宽 |
| orientation | int | N | 设备方向:1 竖屏;2 横屏 |
| geo | [Geo](#1.1.1.1 Geo) | N | 经纬度坐标系定义 |
| make | string | N | 设备品牌 |
| vendor | string | N | 生产厂商 |
| model | string | N | 设备型号 |
| carrier | int | N | ⽹运营商定义:0 未知; 1 移动; 2 联通; 3 电信; 4 铁通 |
| connection_type | int | N | 网络类型:0 未知; 1 以太网; 2 wifi; 3 蜂窝网络; 4 2G; 5 3G; 6 4G; 7 5G |
| os | int | N | 系统:0 未知; 1 iOS; 2 Android |
| osv | string | N | 系统版本 |
| mac | string | N | 设备MAC地址原值 |
| mac_md5 | string | N | 设备MAC地址md5值 |
| imei | string | N | 设备imei原值 |
| imei_md5 | string | N | 设备imei md5值 |
| oaid | string | N | 设备oaid原值 |
| oaid_md5 | string | N | 设备oaid md5值 |
| idfa | string | N | 设备idfa原值 |
| idfa_md5 | string | N | 设备idfa md5值 |
| android_id | string | N |