Sets custom (additional) field values on the entity, as saving the console's Basic Info card does.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/additional-fields/{entityType}/{entityId}.do
Sets custom (additional) field values on the entity, as saving the console's Basic Info card does. The JSON body maps a field to its new value; a field is named by its id or by its name, for example {"7": "Q3 push", "cost_center": "EU-42"}. Only the fields sent change. A value is free text of at most 255 characters; an empty string clears it. A field that does not exist, or belongs to another entity type, refuses the whole request and nothing is saved. Needs update rights on the entity: the advertiser's share for an advertiser, campaign or banner, the site's share for a site, zone or placement. Answers with the entity's values after the save, in the shape of the GET.
Path Params
entityTypestringrequired
Entity type the fields belong to
CAMPAIGN
entityIdintegerrequired
Id of the advertiser, campaign, banner, site, zone or placement
2001
Body
A JSON body. An example, built from the field definitions:
{}
Responses
200
Saved; 'fields' lists {id, name, title, value} for each field of the entity type
400
Empty body, an unknown field, a field of another entity type, or a value longer than 255 characters
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/additional-fields/CAMPAIGN/2001.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new StringContent("{\"cost_center\":\"EU-42\"}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());