Creates a web application targeting rule for the specified placement.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/placement/{placementId}/targeting/is-web-app/create.do
Creates a web application targeting rule for the specified placement. The rule matches traffic that originates from a web application context. Use INCLUDE to target only web app traffic or EXCLUDE to block it. Requires UPDATE permission on the placement and MANAGE_SUPPLY_PRE_TARGETING user permission.
Path Params
placementIdintegerrequired
Unique numeric ID of the placement
4001
Form Params
rulestringrequired
Targeting rule type — INCLUDE for whitelist or EXCLUDE for blacklist
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/placement/4001/targeting/is-web-app/create.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["rule"] = "INCLUDE" });
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());