Overview
You can use this request to merge two lists. You’ll be merging from one list into another. Once the lists have been merged, the one you’re merging from will be deleted.
The Method
API | - | Method |
---|---|---|
REST | POST | https://[Your URL]/api/2.0/list_actions/merge/:from_id/:into_id |
XML-RPC | Call | lists.MergeLists |
Your URL is the address of your install.
Your method must be structured as follows:
MergeLists(integer $from_id, integer $into_id) : boolean
Parameters
The following parameters are required for this request to work:
Property | Type | Description | Required |
---|---|---|---|
$from_id | integer | The ID of the list that should be merged into another list. This list will be deleted after the merge. | yes |
$into_id | integer | The ID of the list into which the other list should be merged. | yes |
Responses
Type | Description |
---|---|
boolean | If the call was successful. |
Code Samples
PHP (using REST API):
$url = '(Your URL)/api/2.0/list_actions/:from_list_id/:into_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);