Overview
You can use this request to update the properties of a specific list.
The Method
API | - | Method |
---|---|---|
REST | PUT | https://[Your URL]/api/2.0/lists/:id |
XML-RPC | Call | lists.UpdateList |
Your URL is the address of your install.
Your method must be structured as follows:
UpdateList(integer $id, \struct | array $properties) : int
Parameters
Required Parameters
The following parameters are required for this request to work:
Property | Type | Description | Required |
---|---|---|---|
$id | integer | The ID of the list to update. | yes |
$properties | structarray | The properties that need to be updated in the list. | yes |
Properties
You can update the following list properties using this method.
Property | Type | Description | Default | Read Only |
---|---|---|---|---|
list_group_id | integer | List group identifier. | 0 | no |
name | string | Name of the list. | empty | no |
public_name | string | Public name of the list. | empty | no |
owner_name | string | Name of the list owner. | empty | no |
owner_email | string | Email address for the list owner. | empty | no |
owner_reply_email | string | The list owner’s reply address. | empty | no |
company_name | string | Name | empty | no |
company_address | string | Address | empty | no |
company_city | string | City | empty | no |
company_state | string | State | empty | no |
company_country | string | Country | empty | no |
company_postal_code | string | Postal Code | empty | no |
company_telephone | string | Telephone Number | empty | no |
company_mobile | string | Mobile Number | empty | no |
company_fax | string | Fax Number | empty | no |
company_email | string | Email Address | empty | no |
company_url | string | URL | empty | no |
notify_owner_on_list_subscribe | string | Notify owner on list subscribe Possible values: yes no | no | no |
notify_owner_on_list_unsubscribe | string | Notify owner on list unsubscribe Possible values: yes no | no | no |
ask_for_unsubscribe_reason | string | Ask for reason on list unsubscribe Possible Values: yes no | no | no |
send_unsubscribe_confirmation | string | Confirmation message sent on unsubscribe Possible values: yes no | no | no |
redirect_url_on_unsubscribe | string | Custom unsubscribe URL | empty | no |
Responses
Type | Description |
---|---|
integer | The ID of the updated list. |
Code Samples
PHP (using REST API):
$json = ' { "public_name":"New list public name", } '; $url = '(Your URL)/api/2.0/lists'; $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_POSTFIELDS, $json); $headers[] = 'Content-Type: application/json'; curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($cSession); curl_close($cSession);