Difference between revisions of "Get Category and Categories"

From KartRocket API
Jump to: navigation, search
 
(10 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
Category information can be fetch by making a HTTP GET Request on the following URL:
 
Category information can be fetch by making a HTTP GET Request on the following URL:
  
<source lang="html4strict">
+
<pre>
  
 
YOUR_STORE_URL_ON_KARTROCKET.’index.php?route=feed/web_api/category&key=’.WEB_API_KEY. ‘&id=’.CATEGORY_ID;
 
YOUR_STORE_URL_ON_KARTROCKET.’index.php?route=feed/web_api/category&key=’.WEB_API_KEY. ‘&id=’.CATEGORY_ID;
  
</source>
+
</pre>
  
''e.g.; http://test.kartrocket.co/index.php?route=feed/web_api/category &key=1234XYZ&id=1;''
+
'''Example'''
 +
 
 +
<pre>
 +
http://test.kartrocket.co/index.php?route=feed/web_api/category &key=1234XYZ&id=1;
 +
</pre>
  
 
=== Response ===
 
=== Response ===
Line 18: Line 22:
 
You will get the following response to the above GET request.
 
You will get the following response to the above GET request.
  
<source>
+
<pre>
  
 
{
 
{
Line 30: Line 34:
 
}
 
}
  
</source>
+
</pre>
  
 
   
 
   
Line 39: Line 43:
  
 
'''id''' : Category Id. (Required)
 
'''id''' : Category Id. (Required)
 
 
  
 
== Get Categories ==
 
== Get Categories ==
Line 48: Line 50:
 
Category information can be fetch by making a HTTP GET Request on the following URL.
 
Category information can be fetch by making a HTTP GET Request on the following URL.
  
 
+
<pre>
  
 
YOUR_STORE_URL_ON_KARTROCKET.’index.php?route=feed/web_api/categories&key=’.WEB_API_KEY. ‘&parent=’.CATEGORY_PARENT_ID. ‘&level=’.CATEGORY_LEVEL;
 
YOUR_STORE_URL_ON_KARTROCKET.’index.php?route=feed/web_api/categories&key=’.WEB_API_KEY. ‘&parent=’.CATEGORY_PARENT_ID. ‘&level=’.CATEGORY_LEVEL;
  
e.g.; http://test.kartrocket.co/index.php?route=feed/web_api/categories &key=1234XYZ&parent=0&level=1;
+
</pre>
  
 +
'''Example'''
 +
<pre>
 +
http://test.kartrocket.co/index.php?route=feed/web_api/categories &key=1234XYZ&parent=0&level=1;
 +
</pre>
  
 
=== Response ===
 
=== Response ===
Line 59: Line 65:
 
You will get the following response to the above GET request.
 
You will get the following response to the above GET request.
  
 
+
<pre>
  
 
{
 
{
Line 100: Line 106:
  
  
 
+
</pre>
 
   
 
   
  

Latest revision as of 12:33, 22 May 2014

Get Category

Request

Category information can be fetch by making a HTTP GET Request on the following URL:


YOUR_STORE_URL_ON_KARTROCKET.’index.php?route=feed/web_api/category&key=’.WEB_API_KEY. ‘&id=’.CATEGORY_ID;

Example

http://test.kartrocket.co/index.php?route=feed/web_api/category &key=1234XYZ&id=1;

Response

You will get the following response to the above GET request.


{
	“success”:true,
	“category”:{
	“id”:”1″,
	“name”:”Accessories”,
	“description”:””,
	“href”:”http://saahil.kartrocket.co/index.php?route=product/category&category_id=1″
	}
}


Parameters Description

key : API Key provided by KartRocket.(Required)

id : Category Id. (Required)

Get Categories

Request

Category information can be fetch by making a HTTP GET Request on the following URL.


YOUR_STORE_URL_ON_KARTROCKET.’index.php?route=feed/web_api/categories&key=’.WEB_API_KEY. ‘&parent=’.CATEGORY_PARENT_ID. ‘&level=’.CATEGORY_LEVEL;

Example

http://test.kartrocket.co/index.php?route=feed/web_api/categories &key=1234XYZ&parent=0&level=1;

Response

You will get the following response to the above GET request.


{
	“success”:true,
	“categories”:[
		{
		"category_id":"1",
		"parent_id":"0",
		"name":"Accessories",
		"image":false,
		"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=1",
		"categories":null
		},
		{
		"category_id":"9",
		"parent_id":"0",
		"name":"Bindass ",
		"image":false,
		"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=9",
		"categories":null
		},
		{
		"category_id":"4",
		"parent_id":"0",
		"name":"Clothing ",
		"image":false,
		"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=4",
		"categories":null
		},
		{
		"category_id":"6",
		"parent_id":"0",
		"name":"Consumables",
		"image":false,
		"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=6",
		"categories":null
		}
	]
}



Parameters Description

key : API Key provided by KartRocket.(Required)

parent : Parent of the category. Used when you want to get subcategories of a particular category. (Optional)

level : Up to which level you want the API to traverse in category tree. (Optional)