POST https://YOUR-NETWORK-DOMAIN/rest-api/template/delete.do
Deletes a creative template by ID. The template cannot be deleted if it is set as the default affiliate template in network preferences. Requires DELETE permission on templates.
Form Params
idinteger
ID of the template — omit on edit to create a new template; delete and export need it
12
activeboolean
Whether the template is active
true
alwaysRedirectboolean
Whether the template always uses redirect mode for click tracking
false
contentstring
Template HTML/JS content body
<div>{{BANNER}}</div>
globalboolean
Whether this is a global (system-wide) template
false
impressionRecordedByTemplateboolean
Whether impression tracking is handled by the template itself
false
maxRequiredNativeAdsAmountinteger
Maximum number of native ads supported by this template
1
minRequiredNativeAdsAmountinteger
Minimum number of native ads required by this template
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/template/delete.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["id"] = "12" });
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());