Remove an existing content block.
Be careful removing Content Blocks that could be used in existing Mailings or Documents, as the removal will break mail merging if the Content Block cannot be found.
DELETE
/API/Rest/ContentBlocks
contentBlockName
DeleteContentBlocks
No Permission
Invalid content block name
Content block is in use for a mailing so cannot be deleted.
Content block is in use for a document so cannot be deleted.
Database error
Unknown error
Success
Delete a content block.
using System;
using System.Net.Http;
string url = "https://example.com/API/Rest/ContentBlocks?accountName=acme&login=ApiUser&contentBlockName=DanaSignature";
// Reuse HttpClient for multiple requests in production code.
using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Delete, url))
{
request.Headers.Add("Password", "YOUR_PASSWORD");
using (HttpResponseMessage response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
# encoding: utf-8
require 'rest-client'
require 'json'
url = 'https://example.com/API/Rest/ContentBlocks?accountName=Acme&login=ApiUser&contentBlockName=DanaSignature'
response = RestClient.delete(url, {:password => "YOUR_PASSWORD"})
puts response
import requests
url = "https://example.com/API/Rest/ContentBlocks?accountName=acme&login=ApiUser&contentBlockName=DanaSignature"
headers = {'password':'YOUR_PASSWORD'}
resp = requests.delete(url, headers=headers)
if resp.status_code == 200:
print(resp.text)
curl --request DELETE --header "Password: YOUR_PASSWORD" "https://example.com/API/Rest/ContentBlocks?accountName=acme&login=ApiUser&contentBlockName=DanaSignature"