POST https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do
Registers a parameter the ad tags send. name is needed. Invalid values come back per field in errors; fields that were sent but not applied are listed in 'ignoredFields'. Ad serving reads the change within a minute. Requires the CUSTOM_PARAMETERS admin permission (Admin → Targeting presets → Custom parameters).
Body
A JSON body. An example, built from the field definitions:
{
"name": "genre",
"label": "Content genre",
"description": "Genre of the page, from the publisher's CMS",
"valueMode": "STATIC"
}
Responses
200
{parameter, ignoredFields}
400
Invalid body, each problem named in errors by field
curl --request POST \
--url 'https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "genre",
"label": "Content genre",
"description": "Genre of the page, from the publisher'\''s CMS",
"valueMode": "STATIC"
}'
Python Request
import requests
response = requests.request("POST", "https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do", headers={"X-Api-Key": "YOUR_API_KEY"}, json={
"name": "genre",
"label": "Content genre",
"description": "Genre of the page, from the publisher's CMS",
"valueMode": "STATIC"
})
print(response.json())
Node Request
const response = await fetch('https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do', {
method: 'POST',
headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "genre",
"label": "Content genre",
"description": "Genre of the page, from the publisher's CMS",
"valueMode": "STATIC"
}),
});
console.log(await response.json());
Java Request
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do"))
.header("X-Api-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"genre\",\"label\":\"Content genre\",\"description\":\"Genre of the page, from the publisher's CMS\",\"valueMode\":\"STATIC\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
C# Request
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new StringContent("{\"name\":\"genre\",\"label\":\"Content genre\",\"description\":\"Genre of the page, from the publisher's CMS\",\"valueMode\":\"STATIC\"}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Go Request
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do", strings.NewReader(`{"name":"genre","label":"Content genre","description":"Genre of the page, from the publisher's CMS","valueMode":"STATIC"}`))
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
PHP Request
<?php
$ch = curl_init("https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-Api-Key: YOUR_API_KEY", "Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"genre","label":"Content genre","description":"Genre of the page, from the publisher\'s CMS","valueMode":"STATIC"}');
echo curl_exec($ch);
curl_close($ch);
Ruby Request
require 'net/http'
require 'json'
uri = URI("https://YOUR-NETWORK-DOMAIN/rest-api/custom-parameters.do")
request = Net::HTTP::Post.new(uri)
request['X-Api-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = "{\"name\":\"genre\",\"label\":\"Content genre\",\"description\":\"Genre of the page, from the publisher's CMS\",\"valueMode\":\"STATIC\"}"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
puts response.body
Please disable Adblock
Are you using adblock? Disable it and reload the page to proceed to the destination page.
A registration has already been submitted from this page. Please try again in 10 minutes.