The UpdateCategory service allows you to update existing categories within Flexmail.
SOAP Action: UpdateCategory
SOAP Return Object: UpdateCategoryResp
The following table describes the parameters used for calling the UpdateCategory service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
categoryId | Y | Integer | Id of the category to update |
categoryName | Y | String | Name of the category to update |
The following table describes the parameters returned from the UpdateCategory 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 | Category id is mandatory |
222 | Category id is invalid |
223 | Category name is mandatory |
224 | Category already exists |
This example shows you the update of a category with category id 1234.
<?php $header->userId = USER_ID; $header->userToken = USER_TOKEN; $updateCategoryReq->header = $header; $updateCategoryReq->categoryId = 1234; $updateCategoryReq->categoryName = "My updated category"; $updateCategoryResp = $SoapClient->__soapCall("UpdateCategory", array($updateCategoryReq)); if ($updateCategoryResp->errorCode == 0) { echo "Category updated"; } else { echo "Category update failed: " . $updateCategoryResp->errorMessage; } ?>