Creates a web app targeting rule for the specified site.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/site/{siteId}/targeting/is-web-app/create.do
Creates a web app targeting rule for the specified site. The rule matches requests that originate from a web application context (progressive web app or app-like browser environment). Use INCLUDE to serve ads only to web app traffic, or EXCLUDE to block it. Returns the created targeting rule on success. Requires IS_WEB_APP targeting permission.
Path Params
siteIdintegerrequired
Unique numeric ID of the site
3001
Form Params
rulestringrequired
Targeting rule type — INCLUDE to target web app traffic or EXCLUDE to block it
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/site/3001/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());