Creates a WiFi traffic targeting rule for the specified site.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/site/{siteId}/targeting/wifi-traffic/create.do
Creates a WiFi traffic targeting rule for the specified site. The rule matches ad requests from devices connected via WiFi (as opposed to mobile/cellular data). Use INCLUDE to serve ads only to WiFi-connected users, or EXCLUDE to block WiFi traffic. Returns the created targeting rule on success. Requires WIFI_TRAFFIC targeting permission.
Path Params
siteIdintegerrequired
Unique numeric ID of the site
3001
Form Params
rulestringrequired
Targeting rule type — INCLUDE to target WiFi 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/wifi-traffic/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());