REST Email Marketing API Documentation

Topics — Remove

Remove an unused topic. Once a topic has been used to record unsubscribes for a mailing or document it can no longer be removed or the unsubscribe information would be lost.

HTTP VERB

Delete

URL

/API/Rest/Topics

ARGUMENTS

topicName


Required permission

DeleteTopic

ERRORS

No Permission
Topic does not exist
Topic is in use, so cannot be deleted
Too many API calls
Database error
Unknown error

RETURNS

Success


EXAMPLE

Remove a topic.

using System;
using System.Net.Http;

string url = "https://example.com/API/Rest/Topics?accountName=acme&login=ApiUser&topicName=TestTopic1";

// 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/Topics?accountName=acme&login=ApiUser&password=YOUR_PASSWORD&topicName=TestTopic1'
response = RestClient.delete(url, {:Password => "YOUR_PASSWORD"})
puts response						
							
import requests
url = "https://example.com/API/Rest/Topics?accountName=acme&login=ApiUser&password=YOUR_PASSWORD&topicName=TestTopic1"
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/Topics?accountName=acme&login=ApiUser&topicName=TestTopic1"