Service: DeleteMessage

The DeleteMessage service allows you to delete existing messages within Flexmail.

Service Details

SOAP Action: DeleteMessage
SOAP Return Object: DeleteMessageResp

Input

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

Table: instance of DeleteMessageReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
messageType Y MessageType Message type

Output

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

Table: instance of DeleteMessageResp

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 DeleteMessageResp.

0 No error
220 Authentication error, see header object for detailed information
221 Message id is mandatory
222 Invalid message id
223 Internal error

Example

This example shows you the deletion of a message with id 956.

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

$deleteMessageReq->header = $header;
$deleteMessageReq->messageType->messageId = 1;

$deleteMessageResp = $SoapClient->__soapCall("DeleteMessage",array($deleteMessageReq));
$deleteMessageResp = $SoapClient->__soapCall("DeleteMessage",array($deleteMessageReq));

if ($deleteMessageResp->errorCode == 0) {
	echo "Message deleted";
} else {
	echo "Message deletion failed: " . $deleteMessageResp->errorMessage;
}
?>