Service: CreateGroup

Note: Groups are called Interest Labels in the GUI

The CreateGroup service allows you to create a new group within Flexmail. The ID of the newly created group will be returned to you.

Service Details

SOAP Action: CreateGroup
SOAP Return Object: CreateGroupResp

Input

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

Table: instance of CreateGroupReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
groupType Y GroupType Group type to create

Output

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

Table: instance of CreateGroupResp

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
groupId / Integer Id of the new group

Table: response codes of CreateGroupResp.

0 No error
220 Authentication error, see header object for detailed information
221 Group name is mandatory
222 Group already exists
223 Internal error

Example

This example shows you the creation of a new group within Flexmail, the name of our group is "my new group".

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

$createGroupReq->header = $header;
$createGroupReq->groupType->groupName = "my new group";

$createGroupResp = $SoapClient->__soapCall("CreateGroup", array($createGroupReq));

if ($createGroupResp->errorCode == 0) {
	echo "Group created, the new template id=" . $createGroupResp->groupId;
} else {
	echo "Template creation failed: " . $createGroupResp->errorMessage;
}
?>