Difference between revisions of "Get Category and Categories"

From KartRocket API
Jump to: navigation, search
(Created page with "== 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_ap...")
 
 
(20 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
Request
+
=== Request ===
  
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/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;
  
e.g.; http://test.kartrocket.co/index.php?route=feed/web_api/category &key=1234XYZ&id=1;
+
</pre>
 +
 
 +
'''Example'''
 +
 
 +
<pre>
 +
http://test.kartrocket.co/index.php?route=feed/web_api/category &key=1234XYZ&id=1;
 +
</pre>
  
Response
+
=== Response ===
  
 
You will get the following response to the above GET request.
 
You will get the following response to the above GET request.
  
[cc lang="php"]
+
<pre>
  
 
{
 
{
“success”:true,
+
“success”:true,
“category”:{
+
“category”:{
“id”:”1″,
+
“id”:”1″,
“name”:”Accessories”,
+
“name”:”Accessories”,
“description”:””,
+
“description”:””,
“href”:”http://saahil.kartrocket.co/index.php?route=product/category&category_id=1″
+
“href”:”http://saahil.kartrocket.co/index.php?route=product/category&category_id=1″
}
+
}
 
}
 
}
  
[/cc]
+
</pre>
  
 
   
 
   
  
Parameters Description
+
==== Parameters Description ====
 
 
key : API Key provided by KartRocket.(Required)
 
  
id : Category Id. (Required)
+
'''key''' : API Key provided by KartRocket.(Required)
  
+
'''id''' : Category Id. (Required)
  
Get Categories
+
== Get Categories ==
  
Request
+
=== Request ===
  
 
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.
  
[cc lang="php"]
+
<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>
  
[/cc]
+
'''Example'''
 +
<pre>
 +
http://test.kartrocket.co/index.php?route=feed/web_api/categories &key=1234XYZ&parent=0&level=1;
 +
</pre>
  
Response
+
=== Response ===
  
 
You will get the following response to the above GET request.
 
You will get the following response to the above GET request.
  
[cc lang="php"]
+
<pre>
  
 
{
 
{
“success”:true,
+
“success”:true,
“categories”:[
+
“categories”:[
{
+
{
"category_id":"1",
+
"category_id":"1",
"parent_id":"0",
+
"parent_id":"0",
"name":"Accessories",
+
"name":"Accessories",
"image":false,
+
"image":false,
"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=1",
+
"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=1",
"categories":null
+
"categories":null
},
+
},
{
+
{
"category_id":"9",
+
"category_id":"9",
"parent_id":"0",
+
"parent_id":"0",
"name":"Bindass ",
+
"name":"Bindass ",
"image":false,
+
"image":false,
"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=9",
+
"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=9",
"categories":null
+
"categories":null
},
+
},
{
+
{
"category_id":"4",
+
"category_id":"4",
"parent_id":"0",
+
"parent_id":"0",
"name":"Clothing ",
+
"name":"Clothing ",
"image":false,
+
"image":false,
"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=4",
+
"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=4",
"categories":null
+
"categories":null
},
+
},
{
+
{
"category_id":"6",
+
"category_id":"6",
"parent_id":"0",
+
"parent_id":"0",
"name":"Consumables",
+
"name":"Consumables",
"image":false,
+
"image":false,
"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=6",
+
"href":"http://test.kartrocket.co/index.php?route=product/category&category_id=6",
"categories":null
+
"categories":null
}
+
}
]
+
]
 
}
 
}
  
[/cc]
 
  
 +
</pre>
 
   
 
   
  
Parameters Description
+
==== Parameters Description ====
  
key : API Key provided by KartRocket.(Required)
+
'''key''' : API Key provided by KartRocket.(Required)
  
parent : Parent of the category. Used when you want to get subcategories of a particular category. (Optional)
+
'''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)
+
'''level''' : Up to which level you want the API to traverse in category tree. (Optional)

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)