« Back to Documentation OverviewlistInterestGroups – v1.1
listInterestGroups(string apikey, string id)
Get the list of interest groups for a given list, including the label and form information
| Parameters | xml-rpc_listInterestGroups.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() |
| Returns | | struct |
list of interest groups for the list |
| Returned Fields | string | name | Name for the Interest groups | string | form_field | Gives the type of interest group: checkbox,radio,select | array | groups | Array of the group names |
Examples (1)
download example code
[1] xml-rpc_listInterestGroups.php
<?php
/**
This Example shows how to retrieve the Interest Group setup for 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->listInterestGroups($apikey, $listId);
echo "Interest Group setup -\n"; echo "Name: ".$result['name']."\n"; echo "Form Field: ".$result['form_field']."\n"; foreach ($result['groups'] as $grp){
}
} catch (XML_RPC2_FaultException $e){
echo $e->getFaultCode()." : ".$e->getFaultString()."\n"; }