question

sweatband avatar image
0 Likes"
sweatband asked

GetCategories not returning all categories

Hi everyone, I'm trying to retrieve the ebay categories by using the GetCategories call and it doesn't return all the subcategories that are on the site. For instance the Squash Equipment has Rackets, Clothing, Shoes etc. subcategories but the call only returns the Squash (62166) category. I've searched the nodes by name, and by the parent id of Squash (62166) and i couldn't find anything. https://www.ebay.co.uk/b/Squash-Equipment/62166 What's more strange some of our listings get automatically assigned to these subcategories, so my question is are these real ebay subcategories or is it some sort of internal ebay category subclassification? I'm currently downloading only specific parent nodes, but i tried getting all the nodes and it didn't help.
categoriesmissingwsdlgetcategoriessubcategories
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sree_developersupport avatar image
0 Likes"
sree_developersupport answered
Hi @sweatband, Thanks for your post. GetCategories does return the subcategories. Please use the tag ViewAllNodes and set it to true. This flag controls whether all eBay categories (that satisfy input filters) are returned, or only leaf categories (you can only list items in leaf categories) are returned. The default value is 'true', so if this field is omitted, all eBay categories will be returned. If you only want to retrieve leaf categories, include this flag and set it to 'false'. The actual data returned will vary depending on how you configure other fields in the request. By Default the flag is set to false. Please refer to the documentation https://developer.ebay.com/Devzone/XML/docs/Reference/eBay/GetCategories.html for more information. Thanks, eBay Developer Support
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sweatband avatar image
0 Likes"
sweatband answered
Hi, Thank you for the reply. We're already setting the ViewAllNodes explicitly as true, and yet the Rackets, Clothing, Shoes etc. are not returned. This is how we are creating the call: private void CallEbayWithRootNodes(RootNodeFilterModel[] rootNodes) { var call = CreateCategoryCall(); call.CategoryParent = new StringCollection(); foreach(var root in rootNodes) { call.CategoryParent.Add(root.Identifier); } call.Execute(); if (call.ApiResponse.Ack == AckCodeType.Success || call.ApiResponse.Ack == AckCodeType.Warning) { //Category processing done here } } private GetCategoriesCall CreateCategoryCall() { var call = new GetCategoriesCall(); call.ApiContext = SharedFunctions.GetApiContext(false); call.CategorySiteID = ((int) GlobalData.Instance.EbaySiteCode).ToString(); call.ViewAllNodes = true; call.DetailLevelList = new DetailLevelCodeTypeCollection(); call.DetailLevelList.Add(DetailLevelCodeType.ReturnAll); return call; } public static ApiContext GetApiContext(bool isLogEnabled = false) { if (apiContext != null) { return apiContext; } apiContext = new ApiContext(); apiContext.SoapApiServerUrl = GlobalData.Instance.EbayWebServiceUrl; apiContext.EPSServerUrl = GlobalData.Instance.EbayPictureServiceUrl; var credentials = new ApiCredential(); credentials.eBayToken = GlobalData.Instance.AuthToken; credentials.ApiAccount.Application = GlobalData.Instance.AppId; credentials.ApiAccount.Certificate = GlobalData.Instance.AuthCert; credentials.ApiAccount.Developer = GlobalData.Instance.DevId; apiContext.ApiCredential = credentials; apiContext.Site = GlobalData.Instance.EbaySiteCode; if (isLogEnabled) { string loggerName = "api_listings_" + DateTime.Now.ToShortDateString() + ".txt"; apiContext.ApiLogManager = new ApiLogManager(); apiContext.ApiLogManager.ApiLoggerList.Add(new FileLogger(loggerName, true, true, true)); apiContext.ApiLogManager.EnableLogging = true; } return apiContext; }
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.