Changes the invocation code domain (the host used in placement invocation code snippets) for the specified site.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/sites/{siteId}/changeInvocationCodeDomain.do
Changes the invocation code domain (the host used in placement invocation code snippets) 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 INVOCATION_CODE_DOMAIN permission must be enabled. SSP sites cannot have their domain changed.
Path Params
siteIdintegerrequired
Unique numeric ID of the site
5001
Form Params
hoststring
Invocation code 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/changeInvocationCodeDomain.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["host"] = "cdn.example.com" });
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());