Simple DSP(Demand Side Platform) API written in golang compliant with OpenRTB v2.3
If required midllewares were not installed in your machine, please set up and run at first.
Copy source to your local dierctory.
$ git clone [email protected]:satoshi03/go-dsp-api.git
Install go libs and compile.
$ go get
$ go build
Copy config and edit.
$ cp config/config.yml.def config.yml
$ vim config.yml
Run.
$ ./go-dsp-api
Receive RTB request. RTB request must be compliant with OpenRTB v2.3
-
Response 200 (application/json)
- Headers
x-openrtb-version: 2.3
- Body
{ "cur": "JPY", "id": "IxexyLDIIk", "seatbid": [ { "bid": [ { "adid": "1234", "adm": "<a href=\"http://test.noadnolife.com/v1/click/12345?impid=${AUCTION_IMP_ID}&price=${AUCTION_PRICE}\"><img src=\"http://test.noadnolife.com/img/12345?impid=${AUCTION_IMP_ID}&price=${AUCTION_PRICE}\" width=\"728\" height=\"90\" border=\"0\" alt=\"Advertisement\" /></a>", "cid": "1234", "crid": "12345", "id": "d8aa5114-cd86-4484-9947-b907c8d12daa", "impid": "1", "iurl": "http://test.noadnolife.com/img/12345.png", "nurl": "http://test.noadnolife.com/v1/win/12345?impid=${AUCTION_IMP_ID}&price=${AUCTION_PRICE}", "price": 225 } ] } ] }
-
Response 204 (application/json)
- Headers
x-openrtb-version: 2.3
Receive win notice. In order to track logs, price and impression ID are required.
-
Parameters
- price (number, required) - Won price of RTB Auction
- impid (number, required) - An impression ID of win notice
-
Response 200 (application/json)
- Headers
x-openrtb-version: 2.3
- Body
{ "message": "ok" }
Receive click action log. In order to track logs, price and impression ID are required.
-
Parameters
- price (number, required) - Won price of RTB Auction
- impid (number, required) - An impression ID of win notice
-
Response 200 (application/json)
- Headers
x-openrtb-version: 2.3
- Body
{ "message": "ok" }
Put mock data to Redis.
$ cd command
$ go run create_mock.go
Send RTB Request via httpie
$ http POST http://<host>/v1/bid < examples/request.mobile.json
Send Win Notice
$ http GET http://<host>/v1/win/XXXX impid==YYYYYYYY price==100
If you want to add/modify mock data, please edit data file.
$ vim command/data.yml
See Licence