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
RESTPOSThttps://[Your URL]/api/2.0/list_actions/merge/:from_id/:into_id
XML-RPCCalllists.MergeLists

Your method must be structured as follows:

Parameters

The following parameters are required for this request to work:

PropertyTypeDescriptionRequired
$from_idintegerThe ID of the list that should be merged into another list. This list will be deleted after the merge.yes
$into_idintegerThe ID of the list into which the other list should be merged.yes

Responses

TypeDescription
booleanIf 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);