The UpdateMessage service allows you to update existing messages within Flexmail.
SOAP Action: UpdateMessage
SOAP Return Object: UpdateMessageResp
The following table describes the parameters used for calling the UpdateMessage service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
messageType | Y | MessageType | Message type |
The following table describes the parameters returned from the UpdateMessage 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 |
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 |
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; } ?>