Skip to main content
Published: October 11 2006, 4:24:00 PMUpdated: August 19 2022, 4:48:13 AM

I am sending in the following GetCategories request:
<?xml version="1.0" encoding="utf-8"?>
GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">


However, this is what I get back in the response:

<?xml version="1.0" encoding="UTF-8" ?>
<GetCategoriesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <CategoryArray />


Why is it not returning any Category Nodes?


If you specify the CategoryParent in the GetCategories call, you need to ensure that you pass in a valid value.  0 is not a valid CategoryID and hence it does not return any Category node in the response. 

Detailed Description

In the example, if the intention is to get all the top level Categories, then do not send in the CategoryParent tag in the request.  It will automatically default to the root and return all the top level categories.

We do find that some developers pass in a value of -1. Although the call does seem to return the Category Nodes correctly, passing in negative values is not correct.  At the moment, the call is ignoring the negative value to, not passing in any CategoryParent tag.  However, you should not rely on this behavior and adopt the correct practice, which is to not send in the CategoryParent tag.

Here is the correct GetCategories call to return the top level categories:

<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">

Version Info

The code example above was based on the versions specified below:

API Schema Version 1267




How well did this answer your question?
Answers others found helpful