The GetCategories service allows you to get a list of all category items.
SOAP Action: GetCategories
SOAP Return Object: GetCategoriesResp
The following table describes the parameters used for calling the GetCategories service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
The following table describes the parameters returned from the GetCategories 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 |
categoryTypeItems | / | Array of CategoryType | Array of all categories |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
This example shows you how to get a selection of categories.
<?php $header->userId = USER_ID; $header->userToken = USER_TOKEN; $getCategoriesReq->header = $header; $getCategoriesResp = $SoapClient->__soapCall("GetCategories", array($getCategoriesReq)); if ($getCategoriesResp->errorCode == 0) { foreach ($getCategoriesResp->categoryTypeItems as $categoryType) { echo $categoryType->categoryId . " - " . $categoryType->categoryName; } } else { echo "GetCategories failed: " . $getCategoriesResp->errorMessage; } ?>