Skip to content

Commit

Permalink
PBS request example (#5381)
Browse files Browse the repository at this point in the history
* pbs auction example

* cont

* lint

* trying to work around build failure

* Update prebid-server/endpoints/openrtb2/auction-request-example.md

---------

Co-authored-by: Muki Seiler <[email protected]>
  • Loading branch information
bretg and muuki88 authored Jun 13, 2024
1 parent e03e747 commit a11c1be
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 0 deletions.
4 changes: 4 additions & 0 deletions faq/prebid-server-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ In the long run, if you'd prefer to change the filenames too, that's ok - but ou
1. Submit a PR that changes the filenames and makes the old name a hard-coded alias.
2. Keep both bidder documentation files.

## May I build a server that calls Prebid Server?

Sure. The main endpoint you're going to utilize is the [auction endpoint](/prebid-server/endpoints/openrtb2/pbs-endpoint-auction.html). Basically, it's just OpenRTB 2.6, but with quite a few Prebid-specific extensions. See the [auction request example](/prebid-server/endpoints/openrtb2/auction-request-example.html).

## Should Prebid bidders be in ads.txt?

Publishers should be careful to list all their bidding partners in their ads.txt file. Bidders without an entry in ads.txt may be
Expand Down
2 changes: 2 additions & 0 deletions prebid-server/developers/add-new-bidder-go.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Bid adapters are responsible for translating a 'Prebid-flavored' OpenRTB Bid Req

OpenRTB Bid Requests contain one or more impression objects, each representing a single ad placement. An impression may define multiple sizes and/or multiple ad formats. If your bidding server limits requests to a single ad placement, size, or format, then your adapter will need to split the impression into multiple calls and merge the responses.

See the [example auction request](/prebid-server/endpoints/openrtb2/auction-request-example.html) to get an idea for what your adapter will receive.

## Plan Your Bid Adapter

The job of your bid adapter is to adapt. You'll need to think about currency, floors, mediatypes, and other details as noted below.
Expand Down
2 changes: 2 additions & 0 deletions prebid-server/developers/add-new-bidder-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Bid adapters are responsible for translating a 'Prebid-flavored' OpenRTB Bid Req

OpenRTB Bid Requests contain one or more impression objects, each representing a single ad placement. An impression may define multiple sizes and/or multiple ad formats. If your bidding server limits requests to a single ad placement, size, or format, then your adapter will need to split the impression into multiple calls and merge the responses.

See the [example auction request](/prebid-server/endpoints/openrtb2/auction-request-example.html) to get an idea for what your adapter will receive.

## Plan Your Bid Adapter

### Choose A Name
Expand Down
245 changes: 245 additions & 0 deletions prebid-server/endpoints/openrtb2/auction-request-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
---
layout: page_v2
sidebarType: 5
title: Prebid Server | Endpoints | OpenRTB2 | Auction Example
---

# Prebid Server | Endpoints | /openrtb2/auction -- Example

This is an example of a Prebid Server-flavored OpenRTB auction request with most fields present.
It serves 2 purposes:

- Give context about what custom server-to-server integrations could implement. i.e. if you're building a server that will sit in front of Prebid Server, these are many of the fields that can be provided.
- Provide an example for bid adapter developers to understand what their code will see for each auction. Prebid Server does modify the auction request before giving it to a bid adapter because individual bidders are not allowed to see details from other adapters. The example is annotated with differences between the incoming auction request and what adapters see.

## POST /openrtb2/auction

```json5
{
"id": "123456789",
"source": {
"tid": "a64e6b91-7bfd-4f0b-9861-99307e41f971"
},
"tmax": 1000,
"imp": [
{
"ext": {
"ae": 1,
"gpid": "/1111/adslot#2",
"data": {
"adserver": {
"name": "gam",
"adslot": "/1111/adslot"
}
},
"tid": "4f8f2e78-94b0-431b-b735-6da38a6f3ef0",
"prebid": { // bid adapters don't see this object
"bidder": {
"bidderAlias": { // bid adapters don't see this object
"placement": 1001 // The contents of this object are seen by adapters at imp[].ext.bidder
}
},
"passthrough": { // bid adapters don't see this object
"attr": "val"
}
}
},
"id": "test-div",
"banner": {
"format": [
{
"w": 300,
"h": 250
},
{
"w": 300,
"h": 600
},
{
"w": 728,
"h": 90
}
]
},
"bidfloor": 0.98,
"bidfloorcur": "USD"
}
],
"test": 1,
"ext": {
"prebid": {
"trace": "verbose",
"returnallbidstatus": true, // bid adapters don't see this object
"auctiontimestamp": 1664308667064,
"cache": { // bid adapters don't see this object
"vastXml": {}
},
"targeting": { // bid adapters don't see this object
"includewinners": true,
"includebidderkeys": false
},
"floors": { // bid adapters don't see this object
"enabled": false
},
"channel": {
"name": "pbjs",
"version": "v7.17.0"
},
"createtid": false, // bid adapters don't see this object
"integration": "mbjs",
"currency": {
"rates": {
"USD": { "UAH": 24.47, "ETB": 32.04 }
},
"usepbsrates": true
},
"debug": true,
"aliases": { // bid adapters don't see this object
"bidderAlias": "bidderA"
},
"aliasgvlids": { // bid adapters don't see this object
"bidderAlias": 999999
},
"bidadjustmentfactors": { // bid adapters don't see this object
"bidderA": 0.9
},
"bidderparams": { // bid adapters don't see this object
"bidderA": {
"globalparam": "value" // bid adapter will see this added to the imp.ext.bidder object
}
},
"schains": [{
"bidders": ["bidderA"],
"schain": { SCHAIN OBJECT 1} // bid adapters will see their schain on source.[ext.]schain.
}],
"server": {
"externalurl": "https://prebid-server.example.com",
"gvlid": 9999999,
"datacenter": "us-east-1"
},
"data": {
"eidpermissions": [ // bid adapters don't see this object
{"source": "sharedid.org", "bidders": ["*"]}, // * is the default
]
},
"biddercontrols": { // bid adapters don't see this object
"bidderB": { "prefmtype": "video" }
},
"bidderconfig": [ // bid adapters don't see this object
{
"bidders": [
"bidderAlias"
],
"config": {
"ortb2": {
"site": {
"ext": {
"data": {
"customsite": "customsite1"
}
}
},
"user": {
"ext": {
"data": {
"customuser": "customuser1"
}
}
}
}
}
}
]
}
},
"cur": [
"CAD"
],
"site": {
"publisher": {
"id": "1001",
"domain": "example.com"
},
"page": "http://lh.example.com/prebid_server_kitchen_sink.html?pbjs_debug=true",
"domain": "site-domain",
"keywords": "skw1,skw2",
"name": "site-name",
"cat": [
"site-cat"
],
"sectioncat": [
"site-scat"
],
"pagecat": [
"site-pcat"
],
"ref": "site-ref",
"search": "site-search",
"content": {
"userrating": "4",
"data": [
{
"name": "www.dataprovider1.com",
"ext": {
"segtax": 6
},
"segment": [
{
"id": "123"
},
{
"id": "456"
}
]
}
]
},
"ext": {
"data": {
"siteextdata": "site-ext-data",
"siteextdata2": "site-ext-data2"
}
}
},
"device": {
"w": 1434,
"h": 686
},
"regs": {
"gdpr": 1,
"coppa": 0,
"gpp": "DBABBg~BVpAAEBY.QA",
"gpp_sid": [7]
},
"user": {
"ext": {
"consent": "CO_d4kAPPVBUAADABCENB0CoAP_AAE7AAAAAF5wAwAQAA0AXmBecAMAEAANAF5gAAA.YAAAAAAAA4AA",
"data": {
"userextdata": "user-ext-data",
"userextdata2": "user-ext-data2"
}
},
"keywords": "ukw1,ukw2",
"data": [
{
"name": "www.dataprovider1.com",
"ext": {
"segtax": 4
},
"segment": [
{
"id": "123"
},
{
"id": "456"
}
]
}
]
}
}
```

### Further Reading

- [PBS auction endpoint](/prebid-server/endpoints/openrtb2/pbs-endpoint-auction.html)
1 change: 1 addition & 0 deletions prebid-server/endpoints/openrtb2/pbs-endpoint-auction.md
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,7 @@ The Prebid SDK version comes from:

### Further Reading

- [Example auction request](/prebid-server/endpoints/openrtb2/auction-request-example.html)
- [OpenRTB 2.4 Specification](https://iabtechlab.com/wp-content/uploads/2016/04/OpenRTB-API-Specification-Version-2-4-FINAL.pdf)
- [OpenRTB 2.5 Specification](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf)
- [OpenRTB 2.6 Specification](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md)

0 comments on commit a11c1be

Please sign in to comment.