Removes the file from the library and from the creative editor's picker.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/media-library/assets/{assetId}/delete.do
Removes the file from the library and from the creative editor's picker. Creatives already using it keep serving it: the stored file is erased only once no live creative uses it any more. 'usedIn' is the number of live creatives still serving it. A user with shared advertisers may delete only files uploaded for one of their advertisers. Requires the MEDIA_LIBRARY permission and update rights on campaigns.
Path Params
assetIdintegerrequired
Media library file id
42
Responses
200
{success, assetId, usedIn}
400
Bad request — invalid or missing parameters
401
Authentication error
403
The role lacks MEDIA_LIBRARY or campaign update rights, or no rights on the file's advertiser
404
No such file, it is already deleted, or the user cannot see it
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/media-library/assets/42/delete.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());