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...")
 
(Get Category)
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.
Line 10: Line 10:
 
e.g.; http://test.kartrocket.co/index.php?route=feed/web_api/category &key=1234XYZ&id=1;
 
e.g.; http://test.kartrocket.co/index.php?route=feed/web_api/category &key=1234XYZ&id=1;
  
Response
+
=== Response ===
  
 
You will get the following response to the above GET request.
 
You will get the following response to the above GET request.
Line 38: Line 38:
 
   
 
   
  
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"]
+
 
  
 
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;
Line 50: Line 50:
 
e.g.; http://test.kartrocket.co/index.php?route=feed/web_api/categories &key=1234XYZ&parent=0&level=1;
 
e.g.; http://test.kartrocket.co/index.php?route=feed/web_api/categories &key=1234XYZ&parent=0&level=1;
  
[/cc]
 
  
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"]
+
 
  
 
{
 
{
Line 96: Line 95:
 
}
 
}
  
[/cc]
+
 
  
 
   
 
   

Revision as of 11:17, 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.

[cc lang="php"]

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

[/cc]


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)