Overview
You can use this request to empty the contacts out of a specific list.
The Method
API | - | Method |
---|---|---|
REST | POST | https://[Your URL]/api/2.0/list_actions/empty/:id |
XML-RPC | Call | lists.EmptyLists |
Your URL is the address of your install.
Your method must be structured as follows:
EmptyLists(integer $id) : boolean
Parameters
Property | Type | Description | Required |
---|---|---|---|
$id | integer | The ID of the list you need to delete. | yes |
Responses
Type | Description |
---|---|
boolean | Whether or not the list was successfully deleted. |
Code Samples
PHP (using REST API):
$url = '(Your URL)/api/2.0/list_actions/empty/:list_id'; $method = 'POST'; $cSession = curl_init(); $headers = array(); $auth = base64_encode($username . ':' . $apikey); $headers[] = 'Authorization: Basic ' . $auth; curl_setopt($cSession, CURLOPT_URL, $url); curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true); curl_setopt($cSession, CURLOPT_HEADER, false); curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method)); curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($cSession); curl_close($cSession);