editList

Edits a List.

Top ↑

Syntax

int editList( string api_key, array list_details );

Parameters

api_key (string)

The key required to access the API. See Getting Started for more information.

list_details (array)

An associative array of List details to be edited. See remarks below for a description of the values in the list_details array.

Return Value

Returns the List ID on success.

Examples

The following example changes a List's name to Return Customers and moves the List to Folder 2345678.

$list_details = array(
    'id'        => 1234567,         // id of the List to edit
    'folder_id' => 2345678,         // folder_id can be obtained using searchFolders
    'name'      => 'Return_Customers'
);

$api = new Api($url, 'YOURAPIKEY');
$list_id = $api->invokeMethod('editList', $list_details);
{
    "id": 1,
    "method": "editList",
    "params": [
        "YOURAPIKEY",
        {
            "id": 1234567,
            "folder_id": 2345678,
            "name": "Return_Customers"
        }
    ]
}
{
    "id": 1,
    "result": 1234567,
    "error": null
}

Remarks

The following table shows the structure of the autoresponder_details array.

Key Type Mandatory Description
id int Yes The ID of the List to edit.
name string No Specifies a new name for the List.
folder_id int No Specifies a Folder to move the List into. See searchFolders.
allow_send_to_duplicates bool No Set to true to allow Messages to be sent to duplicate Contacts which have the same address. Set to false to disallow sending to duplicates.
on_register_address string No Sets the comma separated list of addresses which receive a Notification Message when a Contact subscribes to the List.
on_unsubscribe_address string No Sets the comma separated list of addresses which receive a Notification Message when a Contact unsubscribes from the List.
on_update_address string No Sets the comma separated list of addresses which receive a Notification Message when a Contact updates their profile.

Use editField to modify a Field in the List or editContacts to update Contacts.

Error Codes

This method may return the following error codes in addition to the standard error codes:

Code Error Description
310 Invalid Method Parameters id is empty or missing from the list_details array
303 Unable to Load List id is not a valid List
313 Cannot Edit Account Lists id is an Account List. An Account List cannot be edited.
306 Unable to Load Folder folder_id is not a valid Folder
317 Invalid Email Address Specified on_register_address, on_update_address or on_unsubscribe_address contains an invalid email address or mobile number
302 Undefined Error: Unable to save List An internal error occurred while trying to edit the List

See Also