Implement Fluid Ad Server
V2 - Fluid Ad Unit
Fluid Ad Unit v2
code examples curl location globoff 'https //localhost/v2/fluidads/{publisherid}' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "user" { "id" "" }, "adgrids" \[ { "adgridid" "" } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "user" { "id" "" }, "adgrids" \[ { "adgridid" "" } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //localhost/v2/fluidads/{publisherid}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //localhost/v2/fluidads/{publisherid}") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "user" { "id" "" }, "adgrids" \[ { "adgridid" "" } ] }) response = https request(request) puts response read body import requests import json url = "https //localhost/v2/fluidads/{publisherid}" payload = json dumps({ "user" { "id" "" }, "adgrids" \[ { "adgridid" "" } ] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // ok { "adgrids" \[ { "adgridid" "", "products" \[ { "gtin" "", "ext" {}, "beacon urls" \[ "" ], "click url" "", "click urls" \[ "" ], "sponsored" true } ] } ] }// one or more request parameters don't comply to the api specifications { "errors" \[ "" ] }// one of the request ad grid ids is unknown { "errors" \[ "" ] }// one or more ad grid positions are of type display use v3 api instead { "errors" \[ "" ] }