Language
curl --request POST \
--url 'https://YOUR-NETWORK-DOMAIN/rest-api/banner/7890/targeting/day-of-week/create.do' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'rule=INCLUDE' \
--data-urlencode 'dayOfWeek=MONDAY'
import requests
response = requests.request("POST", "https://YOUR-NETWORK-DOMAIN/rest-api/banner/7890/targeting/day-of-week/create.do", headers={"X-Api-Key": "YOUR_API_KEY"}, data={"rule": "INCLUDE", "dayOfWeek": "MONDAY"})
print(response.json())
const response = await fetch('https://YOUR-NETWORK-DOMAIN/rest-api/banner/7890/targeting/day-of-week/create.do', {
method: 'POST',
headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({"rule":"INCLUDE","dayOfWeek":"MONDAY"}),
});
console.log(await response.json());
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://YOUR-NETWORK-DOMAIN/rest-api/banner/7890/targeting/day-of-week/create.do"))
.header("X-Api-Key", "YOUR_API_KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.method("POST", HttpRequest.BodyPublishers.ofString("rule=INCLUDE&dayOfWeek=MONDAY"))
.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/7890/targeting/day-of-week/create.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["rule"] = "INCLUDE", ["dayOfWeek"] = "MONDAY" });
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/7890/targeting/day-of-week/create.do", strings.NewReader(`rule=INCLUDE&dayOfWeek=MONDAY`))
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/7890/targeting/day-of-week/create.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, 'rule=INCLUDE&dayOfWeek=MONDAY');
echo curl_exec($ch);
curl_close($ch);
require 'net/http'
require 'json'
uri = URI("https://YOUR-NETWORK-DOMAIN/rest-api/banner/7890/targeting/day-of-week/create.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('rule' => "INCLUDE", 'dayOfWeek' => "MONDAY")
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
puts response.body