Links the given campaigns to this one as competitors, both ways, the way the console's Competitors card does: each linked competitor has its own competitor separation switched on.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/campaign/{campaignId}/competitors/add.do
Links the given campaigns to this one as competitors, both ways, the way the console's Competitors card does: each linked competitor has its own competitor separation switched on. The campaign's separation must already be on (see competitors/enable). Ids that do not exist are listed in notFound, campaigns the caller may not manage in accessForbidden; they are left alone. Answers the resulting competitor list, as the list endpoint does. Requires the COMPETITOR_CAMPAIGNS permission and UPDATE access to the advertisers of both campaigns.
Path Params
campaignIdintegerrequired
Unique identifier of the campaign
2001
Form Params
competitorIdsarray<integer>required
IDs of the competitor campaigns — repeat the parameter or separate with commas
2002
Responses
200
Competitors linked; competitors lists the campaign's competitors afterwards
400
Competitor separation is off for the campaign, or no competitorIds
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/campaign/2001/competitors/add.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["competitorIds"] = "2002" });
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());