The K2 Module is implemented with the plg_jbackend_k2 plugin. It provides functions related to K2 content construction kit for Joomla (items and categories). Here is the list of supported methods.
action=get module=k2 resource=categories rootid=<R> (optional) endlevel=<E> (optional)
<end-point>?action=get&module=k2&resource=categories&rootid=<R>&endlevel=<E>
<end-point>/get/k2/categories?rootid=<R>
{ "status": "ok", "total": <T>, "categories": [ { "id": "<category id>", "name": "<category name>", "alias": "<category alias>", "description": "<category description>", "parent": "<parent category id>" }, ... { "id": "<category id>", "name": "<category name>", "alias": "<category alias>", "description": "<category description>", "parent": "<parent category id>" } ] }
If rootid is specified, starts to get subcategories from the specified category id instead of the root category. If endlevel is specified, get categories and all subcategories up to the specified number of level, otherwise get all levels (default).
action=get module=k2 resource=categories id=<N>
<end-point>?action=get&module=k2&resource=categories&id=<N>
<end-point>/get/k2/categories/<N>
{ "status": "ok", "id": "<category id>", "name": "<category name>", "alias": "<category alias>", "description": "<category description>", "robots": "<meta robots>", "author": "<meta author>", "language": "<language code>", "parent": "<category id>" }
Language can be "*" if any.
action=get module=k2 resource=items cats=<C1,C2,...,CN> (optional) subs=<0|1> (optional) featured=<0|1|2> (optional) limit=<L> (optional) page=<P> (optional) ordering=<field> (optional)
<end-point>?action=get&module=k2&resource=items&cats=<C>&subs=1
<end-point>/get/k2/items?cats=<C>&limit=<L>&page=<P>
{ "status": "ok", "total": "<total items>", "limit": <pagination limit>, "offset": <pagination offset>, items: [ { "id": "<item id>", "title": "<item title>", "alias": "<item alias>", "content": "<item content>", "featured": "<featured>", "images": { "image": "<image URL>", "imageWidth": "<image width>", "image_caption": "<image caption>", "image_credits": "<image credits>", "imageXSmall": "<image extra small URL>", "imageSmall": "<image small URL>", "imageMedium": "<image medium URL>", "imageLarge": "<image large URL>", "imageXLarge": "<image extra large URL>" }, "video": { "video": "<video URL>", "video_caption": "<video caption>", "video_credits": "<video credits>" }, "language": "<item language>", "category_id": "<category id>", "category_name": "<category name>", "author": "<item author>", "created": "<item creation date>", "modified": "<item modification date>" }, ... { ... } ] }
Cats:
List of categories id to include
Subs:
0=Do not include sub categories (default), 1=Include sub categories
Featured:
0=Hide, 1=Show (default), 2=Show only featured items
Ordering:
date, rdate, alpha, ralpha, order, rorder, featured, hits, rand, best, modified, publishUp, id (default)
Created and modified date format is YYYY-MM-DD HH:MM:SS
action=get module=k2 resource=items id=<N>
<end-point>?action=get&module=k2&resource=items&id=<N>
<end-point>/get/k2/items/<N>
{ "status": "ok", "id": "<item id>", "title": "<item title>", "alias": "<item alias>", "content": "<item content>", "featured": "<featured>", "images": { "image": "<image URL>", "imageWidth": "<image width>", "image_caption": "<image caption>", "image_credits": "<image credits>", "imageXSmall": "<image extra small URL>", "imageSmall": "<image small URL>", "imageMedium": "<image medium URL>", "imageLarge": "<image large URL>", "imageXLarge": "<image extra large URL>" }, "video": { "video": "<video URL>", "video_caption": "<video caption>", "video_credits": "<video credits>" }, "metadesc": "<meta description>", "metakey": "<meta keywords>", "metadata": { "robots": "<meta robots>", "author": "<meta author>", "rights": "<meta content rights>", "xreference": "<meta external reference>" }, "language": "<language code>", "category_id": "<category id>", "category_name": "<category name>", "author": "<item author>", "created": "<item creation date>", "modified": "<item modification date>" }
Created and modified date format is YYYY-MM-DD HH:MM:SS
Language can be "*" if any.
The following options are available for user plugin:
Option | Description |
Full image URL | Generate absolute URL (i.e. with domain) for images fields. |
Full video URL | Generate absolute URL (i.e. with domain) for video fields. |
Full img tag URL | Force absolute URL (i.e. with domain) in any HTML img tag. |
Content in items | Include or exclude full content in the items response. |