Difference between revisions of "Get Category and Categories"

From KartRocket API
Jump to: navigation, search
(Get Category)
Line 5: Line 5:
  
 
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.
 +
 +
<code>
  
 
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;
+
</code>
 +
 
 +
''e.g.; http://test.kartrocket.co/index.php?route=feed/web_api/category &key=1234XYZ&id=1;''
  
 
=== Response ===
 
=== Response ===
Line 14: Line 18:
 
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"]
+
<code>
  
 
{
 
{
“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]
+
</code>
  
 
   
 
   
  
Parameters Description
+
==== Parameters Description ====
  
key : API Key provided by KartRocket.(Required)
+
'''key''' : API Key provided by KartRocket.(Required)
  
id : Category Id. (Required)
+
'''id''' : Category Id. (Required)
  
 
   
 
   
Line 58: Line 62:
  
 
{
 
{
“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
}
+
}
]
+
]
 
}
 
}
  
Line 99: Line 103:
 
   
 
   
  
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)

Revision as of 11:24, 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;

e.g.; 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;

e.g.; 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)