The DeleteCategory service allows you to delete existing categories within Flexmail.
SOAP Action: DeleteCategory
SOAP Return Object: DeleteCategoryResp
The following table describes the parameters used for calling the DeleteCategory service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
categoryId | Y | Integer | Id of the category to delete |
The following table describes the parameters returned from the DeleteCategory 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 | Internal error |
This example shows you the deletion of a category width id 1234.
<?php $header->userId = USER_ID; $header->userToken = USER_TOKEN; $deleteCategoryReq->header = $header; $deleteCategoryReq->categoryId = 1234; $deleteCategoryResp = $SoapClient->__soapCall("DeleteCategory", array($deleteCategoryReq)); if ($deleteCategoryResp->errorCode == 0) { echo "Category deleted"; } else { echo "Category delete failed: " . $deleteCategoryResp->errorMessage; } ?>