Revokes a user's share on an advertiser, as the Shares grid of the console does. The response echoes the userId and advertiserId. Works for a deleted advertiser too, so a share left on one can be cleaned up. Needs the SHARE permission on campaigns at ALL level; at SHARED level the caller's own share on the advertiser must be higher than the one being removed, or the user must be one the caller owns.
Path Params
userIdintegerrequired
ID of the user whose share is removed
5001
advertiserIdintegerrequired
ID of the advertiser the share is on
1001
Responses
200
Share removed: {success, userId, advertiserId}
400
Bad request — invalid or missing parameters
401
Authentication error
403
Not allowed to remove this share
404
No such user or advertiser, or the user has no share on it
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("DELETE"), "https://YOUR-NETWORK-DOMAIN/rest-api/advertiserShares/5001/1001.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());