Service: UpdateMessage

The UpdateMessage service allows you to update existing messages within Flexmail.

Service Details

SOAP Action: UpdateMessage
SOAP Return Object: UpdateMessageResp

Input

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

Table: instance of UpdateMessageReq

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 UpdateMessage service.

Table: instance of UpdateMessageResp

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

0 No error
220 Authentication error, see header object for detailed information
221 Message archived has invalid value
222 Message id is mandatory
223 Message name is mandatory
224 Message text is mandatory
225 Invalid message id
226 Internal error

Example

This example shows you the update of a message with ID 956. We are updating the name and the text of the message.

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

$updateMessasgeReq->header = $header;
$updateMessasgeReq->messageType->messageId= 956;
$updateMessasgeReq->messageType->messageName= "my updated message" ;
$updateMessasgeReq->messageType->messageText = urlencode("<html>update</html>”);

$updateMessasgeResp = $SoapClient->__soapCall("UpdateMessage", array($updateMessasgeReq));

if ($updateMessasgeResp->errorCode == 0) {
	echo "Message updatded";
} else {
	echo "Message update failed: " . $updateMessasgeResp->errorMessage;
}
?>