We created a new viewing experience for our SMS API documentation. It's now all in one central location. Click here to check it out!

This method removes a contact list and all recipients for that list. This method is irreversable so please use caution.


Parameters:


  • id - list identifier required in one of the two following formats:
    • integer - the list id as a numeric value, this can be found by requesting 'contact-lists.get' and using corresponding id values from the dataset
      OR
    • string - the list name EXACTLY as it is in the 'contact-lists.get' response.


 




 




XML Request Example


<?xml version='1.0'?>

<request>

	<version>0.3</version>

	<key>API_KEY</key>

	<secret>API_SECRET</secret>

	<method>contact-lists.delete</method>

	<params>

		<id>1</id>

	</params>

</request>







XML Response Example


<?xml version='1.0'?>

<xml>

	<method>contact-lists.delete</method>

	<total>1</total>

	<time>2009-12-09 05:41:17 GMT</time>

	<timestamp>1260337277 GMT</timestamp>

	<response>DELETED</response>

</xml>







PHP Example


Download the PHP API Client


<?php



// change api key and secret to your own

$myAPIKey = "API_KEY";

$myAPISecret = "API_SECRET";



// include base class

require('APIclient.php');



// create new client object

$transmitsmsAPI = new transmitsmsAPI($myAPIKey, $myAPISecret);



// set parameters

$id = 1;



// execute request

$methodResponse = $transmitsmsAPI->deleteContactList($id);



// parse response into xml object

$xml = @simplexml_load_string($methodResponse);



echo ($xml->response == "DELETED") ? "List has been deleted" : "List was not deleted: " . (string) $xml->response;



?>






GET Example


Using a URL based request system you can request this method by using the below URL - be sure to url encode all your variables!


http://burst.transmitsms.com/api-wrapper/contact-lists.delete?apikey=API_KEY&apisecret=API_SECRET&id=LIST_ID