Service: GetGroups

Note: Groups are called Interest Labels in the GUI

The GetGroups service allows you to retrieve a list of all personal groups within Flexmail.

Service Details

SOAP Action: GetGroups
SOAP Return Object: GetGroupsResp

Input

The following table describes the parameters used for calling the GetGroups service.

Table: instance of GetGroupsReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication

Output

The following table describes the parameters returned from the GetGroups service.

Table: instance of GetGroupsResp

Parameter Mandatory Type Description
header / APIResponseHeader Header containing authentication information
errorCode / Integer Numerical value of the error
errorMessage / String Short literal description of the error
groupTypeItems / Array of GroupType Array of all groups

Table: response codes of GetGroupsResp.

0 No error
220 Authentication error, see header object for detailed information

Example

This example shows you how to get a list of all groups within Flexmail.

<?php
$header->userId = USER_ID;
$header->userToken = USER_TOKEN;

$getGroupsReq->header = $header;
$getGroupsResp = $SoapClient->__soapCall("GetGroups", array($getGroupsReq));

if ($getGroupsResp->errorCode == 0) {
	foreach ($getGroupsResp->groupTypeItems as $groupType) {
		echo $groupType->groupId . " - " . $groupType->groupName;
	}
} else {
	echo "Get groups failed: " . $getGroupsResp->errorMessage;
}
?>