Changes the ad serving domain (the host used for ad delivery URLs) for the specified site.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/sites/{siteId}/changeAdServingDomain.do
Changes the ad serving domain (the host used for ad delivery URLs) for the specified site. Pass null for the host parameter to reset to the system default domain. Requires ALL or SHARED level UPDATE permission on INVENTORY and the AD_SERVING_DOMAIN_INVENTORY permission must be enabled. SSP sites cannot have their domain changed.
Path Params
siteIdintegerrequired
Unique numeric ID of the site
5001
Form Params
hoststring
Ad serving host name to set, or null to reset to system default
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/sites/5001/changeAdServingDomain.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["host"] = "ads.example.com" });
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());