« Back to Documentation OverviewlistMergeVarAdd – v1.1
listMergeVarAdd(string apikey, string id, string tag, string name, boolean req)
Add a new merge tag to a given list
| Parameters | xml-rpc_listMergeVarAdd.php| apikey | a valid API Key for your user account. Get by calling Get by visiting your API dashboard |
| id | the list id to connect to. Get by calling lists() |
| tag | The merge tag to add, e.g. FNAME |
| name | The long description of the tag being added, used for user displays |
| req | optional - Whether or not to require this field to be filled in, defaults to false |
| Returns | | bool |
true if the request succeeds, otherwise an error will be thrown |
Examples (1)
download example code
[1] xml-rpc_listMergeVarAdd.php
<?php
/**
This Example shows how to add an Merge Variable to 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->listMergeVarAdd($apikey, $listId, 'TEST','Testing', false);
echo "Returned: $result\n"; } catch (XML_RPC2_FaultException $e){
echo $e->getFaultCode()." : ".$e->getFaultString()."\n"; }