Back to Documentation Overview

listInterestGroups

public static listInterestGroups(string apikey, string id)

Get the list of interest groups for a given list, including the label and form information

Section:
List Related
Parameters:
apikey a valid API Key for your user account. Get by calling login()
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

  1. <?php
  2. /**
  3. This Example shows how to retrieve the Interest Group setup for one of your
  4. lists using XML-RPC.
  5. Note that we are using the PEAR XML-RPC client and recommend others do as well.
  6. **/
  7. require_once 'XML/RPC2/Client.php';
  8. require_once 'inc/config.inc.php';
  9. try {
  10. $client = XML_RPC2_Client::create($apiUrl);
  11.  
  12. $result = $client->listInterestGroups($apikey, $listId);
  13. echo "SUCCESS! \n";
  14. echo "Interest Group setup -\n";
  15. echo "Name: ".$result['name']."\n";
  16. echo "Form Field: ".$result['form_field']."\n";
  17. echo "Groups:\n";
  18. foreach ($result['groups'] as $grp){
  19. echo "\t$grp\n";
  20. }
  21. } catch (XML_RPC2_FaultException $e){
  22. echo "ERROR!!!!\n";
  23. echo $e->getFaultCode()." : ".$e->getFaultString()."\n";
  24. }
  25.  
  26.  
Add New Note User Contributed Notes for listInterestGroups
No notes, yet... Will you be the first??