Language
Shell Python Node Java C# Go PHP Ruby
curl --request POST \
--url 'https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/companions.do' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'type=STATIC' \
--data-urlencode 'externalCreativeLink=https://cdn.northwind.example/companion-300x250.png' \
--data-urlencode 'markup=<a href="https://northwind.example">Shop now</a>' import requests
response = requests.request("POST", "https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/companions.do", headers={"X-Api-Key": "YOUR_API_KEY"}, data={"type": "STATIC", "externalCreativeLink": "https://cdn.northwind.example/companion-300x250.png", "markup": "<a href=\"https://northwind.example\">Shop now</a>"})
print(response.json()) const response = await fetch('https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/companions.do', {
method: 'POST',
headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({"type":"STATIC","externalCreativeLink":"https://cdn.northwind.example/companion-300x250.png","markup":"<a href=\"https://northwind.example\">Shop now</a>"}),
});
console.log(await response.json()); HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/companions.do"))
.header("X-Api-Key", "YOUR_API_KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("type=STATIC&externalCreativeLink=https%3A%2F%2Fcdn.northwind.example%2Fcompanion-300x250.png&markup=%3Ca%20href%3D%22https%3A%2F%2Fnorthwind.example%22%3EShop%20now%3C%2Fa%3E"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body()); using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/companions.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["type"] = "STATIC", ["externalCreativeLink"] = "https://cdn.northwind.example/companion-300x250.png", ["markup"] = "<a href=\"https://northwind.example\">Shop now</a>" });
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync()); package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/companions.do", strings.NewReader(`type=STATIC&externalCreativeLink=https%3A%2F%2Fcdn.northwind.example%2Fcompanion-300x250.png&markup=%3Ca%20href%3D%22https%3A%2F%2Fnorthwind.example%22%3EShop%20now%3C%2Fa%3E`))
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
} <?php
$ch = curl_init("https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/companions.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/x-www-form-urlencoded"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'type=STATIC&externalCreativeLink=https%3A%2F%2Fcdn.northwind.example%2Fcompanion-300x250.png&markup=%3Ca%20href%3D%22https%3A%2F%2Fnorthwind.example%22%3EShop%20now%3C%2Fa%3E');
echo curl_exec($ch);
curl_close($ch); require 'net/http'
require 'json'
uri = URI("https://YOUR-NETWORK-DOMAIN/rest-api/banner/5001/vast/companions.do")
request = Net::HTTP::Post.new(uri)
request['X-Api-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/x-www-form-urlencoded'
request.set_form_data('type' => "STATIC", 'externalCreativeLink' => "https://cdn.northwind.example/companion-300x250.png", 'markup' => "<a href=\"https://northwind.example\">Shop now</a>")
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
puts response.body