listMergeVars(string apikey, string id)
Get the list of merge tags for a given list, including their name, tag, and required setting
| Section | List Related |
|---|
| Parameters | xml-rpc_listMergeVars.php|
|---|---|
| apikey | a valid API Key for your user account. Get by visiting your API dashboard |
| id | the list id to connect to. Get by calling lists() |
| Returns | |
|---|---|
| array | list of merge tags for the list |
| Returned Fields | string | name | Name of the merge field | bool | req | Denotes whether the field is required (true) or not (false) | string | field_type | The "data type" of this merge var. One of: email, text, number, radio, dropdown, date, address, phone, url, imageurl | bool | public | Whether or not this field is visible to list subscribers | bool | show | Whether the list owner has this field displayed on their list dashboard | string | order | The order the list owner has set this field to display in | string | default | The default value the list owner has set for this field | string | size | The width of the field to be used | string | tag | The merge tag that's used for forms and listSubscribe() and listUpdateMember() | array | choices | For radio and dropdown field types, an array of the options available |
|---|
[1] xml-rpc_listMergeVars.php
<?php /** This Example shows how retrieve the setup of your Merge Variables for a list using XML-RPC. Note that we are using the PEAR XML-RPC client and recommend others do as well. **/ require_once 'XML/RPC2/Client.php'; require_once 'inc/config.inc.php'; try { $result = $client->listMergeVars($apikey, $listId); foreach($result as $i=>$var){ } } catch (XML_RPC2_FaultException $e){ } ?>