Categories are used by the shop to categorize products to make it easier to navigate. Each product can be associated to no, one or multiple categories.
Categories can have a hierarchical structure in which certain categories can be sub categories of others.
What can you do with Category?
The FlickRocket API lets you do the following with the Category resource. More detailed versions of these general actions may be available:
GET /api/categories.json
Receive a list of all categories.
GET /api/categories/count.json
Receive a a count of all categories.
GET /api/categories/#{id}.json
Receive a single Category
POST /api/categories.json
Create a new Category
PUT /api/categories/#{id}.json
Modify an existing Category
DELETE /api/categories/#{id}.json
Remove a Category from the database
Category Properties
comment |
"comment": ""
Comment about a category. It is not used by the shop but displayed in the admin interface.
|
created_at |
"created_at": "2008-06-27T09:40:40"
GMT date and tiem the category was created.
|
enabled |
"enabled": false
Is set to true if the catgory is active.
|
id |
"id": 198
Unique identifier for this category.
|
locales |
locales: []
Localized data for this category.
"id": 1525
Unique identifier for this locale.
"title": "Great Films"
The title of this category. It is displayed in the shop. If no locale for a certain lanaguge is defined, the fallback is to english.
"seo_title": "Great Films"
The HTML title tag used for the category overview page. If not specified, it is dynamically created from the shop data.
"seo_description": "Greatest content of all times"
The HTML description tag used for the category overview page. If not specified, it is dynamically created from the shop data.
"seo_keywords": "Films, Video, Audio"
The HTML keywords tag used for the category overview page.
"description": "Description - Sci-Fi EN"
Description fot this category. Typically this is displayed by the theme on the category overview page.
"src": ""
the URL of an image associated with this category. Can be used for download and upload.
"language": "en"
The two byte language code for this locale.
|
parent_id |
"parent_id": 0
ID of the parent category (if exists)
|
position |
"position": 0
The position of this category element relative to other elements of the same level. "0" is the top position.
|
entries |
"entries": []
Array of elements for each product which are included in this category.
"created_at": "2016-04-15T09:28:44"
GMT date and time when the product was added to the category.
"id": 49043
Unique ID for referencing this element.
"product_id": "0000-E59B-5CAC-9CB2"
Product_id defining the product for this element.
|
title |
"title": "Sci-Fi"
The title of the Category as displayed in the admin interface.
|
Endpoints
GET /api/categories.json
GET /api/categories.json
View Response
{
"categories": [{
"id": 196,
"created_at": "2008-06-27T09:39:13",
"title": "Animation",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [],
"entries": [{
"id": 32689,
"created_at": "2014-12-09T12:01:59",
"product_id": "0000-0B3A-5DA6-3EB3"
}, {
"id": 30086,
"created_at": "2014-10-29T07:50:48",
"product_id": "0000-0ACA-3360-B681"
}, {
"id": 953,
"created_at": "2009-08-25T15:15:51",
"product_id": "0000-11C2-CC03-4AC3"
}]
}, {
"id": 1062,
"created_at": "2013-06-04T14:14:31",
"title": "Audio Books",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [],
"entries": [{
"id": 12685,
"created_at": "2013-06-04T14:17:36",
"product_id": "0000-4E8B-7F9C-E932"
}, {
"id": 12686,
"created_at": "2013-06-04T14:17:36",
"product_id": "0000-4E8A-95B3-E0E6"
}, {
"id": 12687,
"created_at": "2013-06-04T14:17:36",
"product_id": "0000-4E8D-3054-F8C8"
}, {
"id": 12720,
"created_at": "2013-06-10T08:11:25",
"product_id": "0000-4E8C-D1CC-1593"
}]
}, {
"id": 197,
"created_at": "2008-06-27T09:39:33",
"title": "Comedy",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [{
"id": 54,
"title": "Comedy",
"description": "",
"seo_title": "",
"seo_description": "",
"seo_keywords": "",
"src": "",
"language": "en"
}, {
"id": 53,
"title": "Komödie",
"description": "",
"seo_title": "",
"seo_description": "",
"seo_keywords": "",
"src": "",
"language": "de"
}],
"entries": [{
"id": 32690,
"created_at": "2014-12-09T12:01:59",
"product_id": "0000-0B3A-5DA6-3EB3"
}, {
"id": 47167,
"created_at": "2016-01-22T09:41:32",
"product_id": "0000-A4A3-7DB2-8BFA"
}, {
"id": 6788,
"created_at": "2012-04-16T13:54:12",
"product_id": "0000-0B91-DC25-AB9D"
}]
}, {
"id": 1063,
"created_at": "2013-06-04T14:15:21",
"title": "eBooks",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [],
"entries": [{
"id": 12678,
"created_at": "2013-06-04T14:15:40",
"product_id": "0000-4E90-E04D-81F8"
}, {
"id": 12680,
"created_at": "2013-06-04T14:15:40",
"product_id": "0000-4E8F-8363-27D0"
}, {
"id": 12682,
"created_at": "2013-06-04T14:16:53",
"product_id": "0000-4E8E-65E4-306F"
}, {
"id": 12683,
"created_at": "2013-06-04T14:17:09",
"product_id": "0000-4E91-6A77-FC05"
}]
}, {
"id": 198,
"created_at": "2008-06-27T09:40:40",
"title": "Sci-Fi",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [],
"entries": [{
"id": 30087,
"created_at": "2014-10-29T07:50:48",
"product_id": "0000-0ACA-3360-B681"
}, {
"id": 6789,
"created_at": "2012-04-16T13:54:12",
"product_id": "0000-0B91-DC25-AB9D"
}]
}]
}
GET /api/categories/count.json
GET /api/categories/count.json
View Response
{
"count": 5
}
GET /api/categories/#id.json
GET /api/categories/1062.json
View Response
{
"category": {
"id": 1062,
"created_at": "2013-06-04T14:14:31",
"title": "Audio Books",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [],
"entries": [{
"id": 12685,
"created_at": "2013-06-04T14:17:36",
"product_id": "0000-4E8B-7F9C-E932"
}, {
"id": 12686,
"created_at": "2013-06-04T14:17:36",
"product_id": "0000-4E8A-95B3-E0E6"
}, {
"id": 12687,
"created_at": "2013-06-04T14:17:36",
"product_id": "0000-4E8D-3054-F8C8"
}, {
"id": 12720,
"created_at": "2013-06-10T08:11:25",
"product_id": "0000-4E8C-D1CC-1593"
}]
}
}
OST /api/categories.json
POST /api/categories.json
{
"category": {
"title": "New Category",
"enabled": true
}
}
View Response
{
"category": {
"id": 2280,
"created_at": null,
"title": "New Category",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [],
"entries": []
}
}
OST /api/categories/#id.json
POST /api/categories/2280.json
{
"category": {
"id": 2280,
"created_at": null,
"title": "New Category",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [{
"language": "de",
"title": "Neue Kategorie"
}],
"entries": []
}
}
View Response
{
"category": {
"id": 2280,
"created_at": null,
"title": "New Category",
"parent_id": 0,
"position": 0,
"enabled": true,
"comment": "",
"locales": [{
"id": 1485,
"title": "Neue Kategorie",
"description": "",
"seo_title": "",
"seo_description": "",
"seo_keywords": "",
"src": "",
"language": "de"
}],
"entries": []
}
}
DELETE /api/categories/#id.json
DELETE /api/categories/2280.json
View Response
{}