« Back to Documentation OverviewlistInterestGroupAdd – v1.1
listInterestGroupAdd(string apikey, string id, string group_name, mixed grouping_id, int optional)
Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first
group will automatically turn them on.
| Parameters | xml-rpc_listInterestGroupAdd.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() |
| group_name | the interest group to add - group names must be unique within a grouping |
| optional | $grouping_id The grouping to add the new group to - get using listInterestGrouping() . If not supplied, the first grouping on the list is used. |
| Returns | | bool |
true if the request succeeds, otherwise an error will be thrown |
Examples (1)
download example code
[1] xml-rpc_listInterestGroupAdd.php
<?php
/**
This Example shows how to add an Interest Group to one of your lists.
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->listInterestGroupAdd($apikey, $listId, 'A test');
echo "Result returned: ".$result."\n"; } catch (XML_RPC2_FaultException $e){
echo $e->getFaultCode()." : ".$e->getFaultString()."\n"; }