Note: Groups are called Interest Labels in the GUI
The GetGroups service allows you to retrieve a list of all personal groups within Flexmail.
SOAP Action: GetGroups
SOAP Return Object: GetGroupsResp
The following table describes the parameters used for calling the GetGroups service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
The following table describes the parameters returned from the GetGroups service.
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 |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
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; } ?>