Jump to content

Access Sub Categories through PS Standard WebService feature


yashman

Recommended Posts

Hi,

 

PS Version: 1.6.0.11

Theme: Default with slight customization of Color and width

 

Background: I am using www.appery.io to create a mobile app for my website. For this I have activated the WebService in the PS. I am able to access the data perfectly but facing some issues where I need some guidance.

 

Kindly note, I am not a developer and am using the standard webservice features of PS

 

Issue: As understood for PS, Category or Sub Category both are equal. Based on the XML I saw through the webservice, the SubCategories are also stored as Categories but associated using associations. So far I have managed to access the Categories but I am not sure how to access the Sub Categories.

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
	<script id="tinyhippos-injected"/>
	<categories>
		<category>
			<id>...</id>
			<id_parent xlink:href="http://www.abc.com/api/categories/2">...</id_parent>
			<level_depth>...</level_depth>
			<nb_products_recursive notFilterable="true">...</nb_products_recursive>
			<active>...</active>
			<id_shop_default>...</id_shop_default>
			<is_root_category>...</is_root_category>
			<position>...</position>
			<date_add>...</date_add>
			<date_upd>...</date_upd>
			<name>...</name>
			<link_rewrite>...</link_rewrite>
			<description>...</description>
			<meta_title>...</meta_title>
			<meta_description>...</meta_description>
			<meta_keywords>...</meta_keywords>
			<associations>
				<categories nodeType="category" api="categories">
					<category xlink:href="http://www.abc.com/api/categories/36">
						<id>
						<![CDATA[ 36 ]]>
						</id>
					</category>
					<category xlink:href="http://www.abc.com/api/categories/35">
						<id>
						<![CDATA[ 35 ]]>
						</id>
						</category>
				</categories>
				<products nodeType="product" api="products">...</products>
			</associations>
		</category>
	</categories>
</prestashop>

In appery.io I am using the below code the access the Webservice. The below code gives me the header level Categories. Now I want to have the SubCategories.

http://www.abc.com/api/categories?ws_key=XXXXXXXXXXXXXXXX&filter[id]=[3,5000]&filter[active]=[1]&sort=[id_ASC]&filter[id_parent]=[2]

Appreciate if anyone can guide on how to achieve the same. This issue also applies to Products, Product Images etc. basically anything that is tagged under the associations tag. I tried to access the api with 

http://www.abc.com/api/associations/

but unfortunately this does not exist.

 

Edited by yashman (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...