-
Notifications
You must be signed in to change notification settings - Fork 2
Admin Category Page APIs
Ravi Sharma edited this page Jul 13, 2014
·
2 revisions
This api will bring the top category, in following format
Type : GET
Service End point
/ajax/categories/getroot
Response
{
"id": 33132
"name": "Water"
"description":"Full Description of this category"
"parentCategoryId": null,
"imageUrl": "http://xyz.com/abc.jpg",
"root": true
}
This api will bring the child categories of a parent category identified by parentCategoryId,
Type : GET
Service End point
/ajax/categories/getchild/{parentCategoryId}
Response : It will return data in following format
[
{
"id":33133,
"name":"Child of Water",
"parentCategoryId":33132,
"description":"Full description of this category",
"imageUrl": "http://xyz.com/abc.jpg",
"root":false
},
{
"id":33134,
"name":"Second Child of Water",
"parentCategoryId":33132,
"imageUrl": "http://xyz.com/abc.jpg",
"description":"Full description of this category",
"root":false
}
]
This api will save a Category
Type : POST
Service End point
/ajax/categories/save
Request Payload should be in the following format
{
"id":"Reuired if its update else it should be null"
"name": "Water",
"imageUrl": "http://xyz.com/abc.jpg",
"parentCategoryId": 33132, //If creating a child category, else it should be null
"root": true, //true if creating toor category, if you are passing the parentcategoryId that means root=false
"description":"Full description of this category",
}
This will return data in following format
{
"id":33136,
"name":"Water",
"parentCategoryId":33132,
"imageUrl": "http://xyz.com/abc.jpg",
"root":false,
"description":"Full description of this category",
}