Service: GetCategories

The GetCategories service allows you to get a list of all category items.

Service Details

SOAP Action: GetCategories
SOAP Return Object: GetCategoriesResp

Input

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

Table: instance of GetCategoriesReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication

Output

The following table describes the parameters returned from the GetCategories service.

Table: instance of GetCategoriesResp

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

Table: response codes of GetCategoriesResp.

0 No error
220 Authentication error, see header object for detailed information

Example

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;
}
?>