Creates a new label with the specified properties.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/label/create.do
Creates a new label with the specified properties. The JSON request body must include 'value' (label name), and 'defaultLabelObjectType' (1=Banner or 2=Placement) when 'defaultLabel' is true. Optionally include 'defaultLabel' (boolean) and 'defaultLabelPlacementTypes' (array of placement type IDs). Returns validation errors if the value is empty or the object type is invalid. Returns an error if a label with the same value already exists. Requires the LABELS_MANAGEMENT permission.
Body
A JSON body. An example, built from the field definitions:
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/label/create.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new StringContent("{\"id\":\"100\",\"value\":\"Sports\",\"defaultLabel\":\"false\",\"defaultLabelObjectType\":\"1\"}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());