Sample-BidRequest
所有文档

          Cloud DSP

          Sample-BidRequest

          在交付的源码中包含了系统集成测试工具,在Cloud-DSP启动正常后,可以通过该工具向Cloud-DSP发起请求。下面将给出若干个示例请求分别说明在不同场景下的接口使用方式,这些请求均可以通过集成测试工具进行发送。

          3.1 BidRequest for Display Ads

          Cloud-DSP系统可以支持展示广告场景,在展示广告场景下,按照流量来源分别通过PC网页、移动网页和移动App三个场景对请求填充进行说明。

          3.1.1 BidRequest from PC browser

          {
              "id" : "0123456789ABCEDF0123456789ABCEDF",
              "imp" : [
              {
                "id" : "10000001",
                "bidinfo" : [ // 描述当前广告位允许的竞价类型为
                { // CPM,对应底价10元
                  "bidtype" : 0,
                  "bidfloor" : 1000
                },
                { // CPC,对应底价50元
                  "bidtype" : 1,
                  "bidfloor" : 5000
                }
                ],
                "slottype" : SLOT_FIXED,
                "banner" : { // 描述了一个横幅广告位。
                  // 允许展现最大宽度1280,最小宽度600,推荐宽度800,最大高度192,最小高度90,推荐高度120的jpg或gif格式图片
                  "w" : 800,
                  "h" : 120,
                  "wmax" : 1280,
                  "wmin" : 600,
                  "hmax" : 192,
                  "hmin" : 90,
                  "mimes" : ["image/jpg", "image/gif"]
                }
              }
              ],
              "site" : { // 当前广告请求发自cloud-dsp产品介绍页面
                "id" : "12345678",
                "name" : "baidu cloud rtb",
                "domain" : "baidu.com",
                "cat" : ["IAB3", "IAB3-1", "IAB3-11"],
                "page" : "https://cloud.baidu.com/solution/marketing/dsp.html",
                "pagecat" : ["IAB3", "IAB3-1"],
                "ref" : "https://cloud.baidu.com/solution/marketing.html",
                "keywords" : "数字营销,解决方案,百度"
              },
              "device" : { // 当前请求发起自Chrome浏览器,Windows操作系统,宽带连接的PC机器
                "dnt" : False,
                "ua" : "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36",
                "ip" : "216.217.95.94",
                "geo" : {
                  "type" : IP
                },
                "os" : WINDOWS,
                "osv" : "6.3",
                "w" : "1920",
                "h" : "1080",
                "connectiontype" : ETHERNET,
                "devicetype" : PERSONAL_COMPUTER
              },
              "user" : { // 发起当前请求的用户Cookie,用户出生年份信息、性别信息及用户兴趣点
                "id" : "E8EF3354D8038C4A91F381940FB24713",
                "yob" : "1986",
                "gender" : "M",
                "keywords" : "游戏,电影"
              },
              "bcat" : [ // 屏蔽了健康类、餐饮类广告
                "IAB7","IAB8"
              ],
              "badv" : [ // 屏蔽了特殊特殊站点的广告主
                "www.sina.com", "qq.com"
              ]
          }

          3.1.2 BidRequest from Mobile browser

          {
              "id" : "0123456789ABCEDF0123456789ABCEDF",
              "imp" : [
              {
                "id" : "10000001",
                "bidinfo" : [ // 描述当前广告位允许的竞价类型为
                { // CPM,对应底价10元
                  "bidtype" : 0,
                  "bidfloor" : 1000
                },
                { // CPC,对应底价50元
                  "bidtype" : 1,
                  "bidfloor" : 5000
                }
                ],
                "slottype" : SLOT_FIXED,
                "banner" : { // 描述了一个横幅广告位。
                  // 允许展现最大宽度1280,最小宽度600,推荐宽度800,最大高度192,最小高度90,推荐高度120的jpg或gif格式图片
                  "w" : 800,
                  "h" : 120,
                  "wmax" : 1280,
                  "wmin" : 600,
                  "hmax" : 192,
                  "hmin" : 90,
                  "mimes" : ["image/jpg", "image/gif"]
                }
              }
              ],
              "site" : { // 当前广告请求发自cloud-dsp产品介绍页面
                "id" : "12345678",
                "name" : "baidu cloud rtb",
                "domain" : "baidu.com",
                "cat" : ["IAB3", "IAB3-1", "IAB3-11"],
                "page" : "https://cloud.baidu.com/solution/marketing/dsp.html",
                "pagecat" : ["IAB3", "IAB3-1"],
                "ref" : "https://cloud.baidu.com/solution/marketing.html",
                "keywords" : "数字营销,解决方案,百度"
              },
              "device" : { // 当前请求发起自Safari浏览器,iOS操作系统,Wi-Fi连接的平板机器
                "dnt" : False,
                "ua" : "User-Agent:Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
                "ip" : "216.217.95.94",
                "geo" : {
                  "type" : IP
                },
                "os" : IOS,
                "osv" : "9.1",
                "w" : "2048",
                "h" : "1536",
                "connectiontype" : WIFI,
                "devicetype" : TABLET
              },
              "user" : { // 发起当前请求的用户Cookie,用户出生年份信息、性别信息及用户兴趣点
                "id" : "E8EF3354D8038C4A91F381940FB24713",
                "yob" : "1986",
                "gender" : "M",
                "keywords" : "游戏,电影"
              },
              "bcat" : [ // 屏蔽了健康类、餐饮类广告
                "IAB7","IAB8"
              ],
              "badv" : [ // 屏蔽了特殊特殊站点的广告主
                "www.sina.com", "qq.com"
              ]
          }

          3.1.3 BidRequest from Mobile app

          {
              "id" : "0123456789ABCEDF0123456789ABCEDF",
              "imp" : [
              {
                "id" : "10000001",
                "bidinfo" : [ // 描述当前广告位允许的竞价类型为
                { // CPD,对应底价80元
                  "bidtype" : 2,
                  "bidfloor" : 8000
                },
                { // CPC,对应底价50元
                  "bidtype" : 1,
                  "bidfloor" : 5000
                }
                ],
                "slottype" : SLOT_NATIVE,
                "native" : { // 描述了一个原生广告位
                  "assets" : [
                  { // 必须包含长度不超过32个字符的标题
                    "id" : 0,
                    "required" : True,
                    "title" : {
                      "len" : 32
                    }
                  },
                  { // 必须包含宽600高400的jpg图片
                    "id" : 1,
                    "required" : True,
                    "img" : {
                      "type" : MAIN,
                      "w" : 600,
                      "h" : 400,
                      "mimes" : ["image/jpg"]
                    }
                  },
                  { // 可选包含长度不超过256个字符的描述
                    "id" : 2,
                    "required" : False,
                    "data" : {
                      "type" : DESC,
                      "len" : 256
                    }
                  }
                  ]
                }
              }
              ],
              "app" : { // 当前请求发自百度手机App
                "id" : "10001001",
                "name" : "Baidu",
                "domain" : "baidu.com",
                "cat" : ["IAB3", "IAB3-1", "IAB3-11"],
                "page" : "main/result",
                "pagecat" : ["IAB3", "IAB3-1"],
                "ver" : "8.0",
                "bundle" : "com.baidu.searchbox",
                "paid" : False,
                "keywords" : "百度,浏览器",
                "storeurl" : "http://xbox.m.baidu.com/wuxian/?from:1006979s"
              },
              "device" : { // 当前请求发起自Android操作系统,4G网络的手机设备
                "dnt" : False,
                "ua" : "Mozilla/5.0 (Linux; Android 5.0; SM-N9100 Build/LRX21V) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile Safari/537.36 V1_AND_BS_5.3.1_196_YYB_D baidu/5.3.1.2335 NetType/4G",
                "ip" : "216.217.95.94",
                "geo" : {
                  "type" : GPS_LOCATION,
                  "lat" : 40.049733,
                  "lon" : 116.279964
                },
                "did" : "863493028938077",
                "mac" : "00:15:58:c2:85:c7",
                "carrier" : CARRIER_CHINA_MOBILE,
                "make" : "SAMSUNG",
                "model" : "Note 7"
                "os" : ANDROID,
                "osv" : "6.0",
                "w" : "1440",
                "h" : "2560",
                "connectiontype" : CELL_4G,
                "devicetype" : PHONE
              },
              "user" : { // 发起当前请求的用户出生年份信息、性别信息及用户兴趣点
                "yob" : "1986",
                "gender" : "M",
                "keywords" : "游戏,电影"
              },
              "bcat" : [ // 屏蔽了健康类、餐饮类广告
                "IAB7","IAB8"
              ],
              "badv" : [ // 屏蔽了特殊特殊站点的广告主
                "www.sina.com", "qq.com"
              ]
          }

          3.4 BidRequest for Search Ads

          Cloud-DSP系统可以支持搜索广告场景,在搜索广告场景下,PC网页、移动网页和移动App所需的基本信息大体与展示广告场景一致,这里以PC网页的搜索广告场景为例对请求的填充进行说明。

          {
              "id" : "0123456789ABCEDF0123456789ABCEDF",
              "imp" : [
              {
                "id" : "10000001",
                "bidinfo" : [ // 描述当前广告位允许的竞价类型为
                { // CPM,对应底价10元
                  "bidtype" : 0,
                  "bidfloor" : 1000
                },
                { // CPC,对应底价50元
                  "bidtype" : 1,
                  "bidfloor" : 5000
                }
                ],
                "slottype" : SLOT_FIXED,
                "banner" : { // 描述了一个横幅广告位。
                  // 允许展现最大宽度1280,最小宽度600,推荐宽度800,最大高度192,最小高度90,推荐高度120的jpg或gif格式图片
                  "w" : 800,
                  "h" : 120,
                  "wmax" : 1280,
                  "wmin" : 600,
                  "hmax" : 192,
                  "hmin" : 90,
                  "mimes" : ["image/jpg", "image/gif"]
                }
              }
              ],
              "site" : { // 当前广告请求发自cloud-dsp产品介绍页面
                "id" : "12345678",
                "name" : "baidu cloud rtb",
                "domain" : "baidu.com",
                "cat" : ["IAB3", "IAB3-1", "IAB3-11"],
                "page" : "https://cloud.baidu.com/solution/marketing/dsp.html",
                "pagecat" : ["IAB3", "IAB3-1"],
                "ref" : "https://cloud.baidu.com/solution/marketing.html",
                "keywords" : "数字营销,解决方案,百度"
              },
              "device" : { // 当前请求发起自Chrome浏览器,Windows操作系统,宽带连接的PC机器
                "dnt" : False,
                "ua" : "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36",
                "ip" : "216.217.95.94",
                "geo" : {
                  "type" : IP
                },
                "os" : WINDOWS,
                "osv" : "6.3",
                "w" : "1920",
                "h" : "1080",
                "connectiontype" : ETHERNET,
                "devicetype" : PERSONAL_COMPUTER
              },
              "user" : { // 发起当前请求的用户Cookie,用户出生年份信息、性别信息及用户兴趣点
                "id" : "E8EF3354D8038C4A91F381940FB24713",
                "yob" : "1986",
                "gender" : "M",
                "keywords" : "游戏,电影"
              },
              "bcat" : [ // 屏蔽了健康类、餐饮类广告
                "IAB7","IAB8"
              ],
              "badv" : [ // 屏蔽了特殊特殊站点的广告主
                "www.sina.com", "qq.com"
              ],
              "query" : "营销解决方案 营销云 开放云" // 当前竞价请求的搜索关键词
          }
          上一篇
          BidRequest
          下一篇
          BidResponse