Service: DeleteSegment

The DeleteSegment service allows you to delete segments lists within Flexmail.

Service Details

SOAP Action: DeleteSegment
SOAP Return Object: DeleteSegmentResp

Input

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

Table: instance of DeleteSegmentReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
segmentId Y Integer Id of the segment to delete

Output

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

Table: instance of DeleteSegmentResp

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

Table: response codes of DeleteSegmentResp.

0 No error
220 Authentication error, see header object for detailed information
221 segmentId is mandatory
222 segmentId is invalid

Example

This example shows you the deletion of a segment width id 1.

<?php 

$request = new stdClass();

$request->header = new stdClass();
$request->header->userId = MY_USER_ID;
$request->header->userToken = MY_TOKEN;
    
$request->segmentId = 1;

$result = $client->__soapCall("DeleteSegment", [$request]);

if ($result->errorCode == 0) {
	echo "Segment deleted";
} else {
	echo "Segment delete failed: " . $result->errorMessage;
}

?>