Displaying items by tag: item

Saturday, 08 November 2014 00:00

ZOO Module API

The ZOO Module is implemented with the plg_jbackend_zoo plugin. It provides functions related to ZOO extension (applications, categories and items). Here is the list of supported methods.

Get the list of categories

Request parameters

action=get
module=zoo
resource=categories
app=<app id>

Example

<end-point>?action=get&module=zoo&resource=categories&app=<A>

Example (REST format)

<end-point>/get/zoo/categories?app=<A>

Response

{
    "status": "ok",
    "total": <T>,
    "categories": [
        {
            "id": "<category id>",
            "name": "<category name>",
            "alias": "<category alias>",
            "description": "<description>",
            "parent": "<parent id>"
        },
        ...
        {
            "id": "<category id>",
            "name": "<category name>",
            "alias": "<category alias>",
            "description": "<description>",
            "parent": "<parent id>"
        }
]}

 

Get a category

Request parameters

action=get
module=zoo
resource=categories
id=<N>
app=<app id>

Example

<end-point>?action=get&module=zoo&resource=categories&id=<N>&app=<A>

Example (REST format)

<end-point>/get/zoo/categories/<N>?app=<A>

Response

{
    "status": "ok",
    "id": "<category id>",
    "name": "<category name>",
    "alias": "<category alias>",
    "description": "<category description>",
    "application_id": "<application id>",
    "parent": "<parent id>",
    "ordering": "<ordering>",
    "content_subtitle": "<content subtitle>",
    "content_image": "<content image>",
    "content_image_width": "<content image width>",
    "content_image_height": "<content image height>",
    "metadata_title": "<meta title>",
    "metadata_description": "<meta description>",
    "metadata_keywords": "<meta keywords>",
    "metadata_robots": "<meta robots>",
    "metadata_author": "<meta author>"
}

 

Get the list of items

Request parameters

action=get
module=zoo
resource=items
category=<C>
limit=<L> (optional)
page=<P> (optional)
app=<app id>

Example

<end-point>?action=get&module=zoo&resource=items&category=<C>&app=<A>

Example (REST format)

<end-point>/get/zoo/items?category=<C>&app=<A>

Response

{
    "status": "ok",
    "total": <T>,
    "limit": <L>,
    "page": <P>,
    "items": [
        {
            "id": "<item id>",
            "name": "<item name>",
            "alias": "<item alias>",
            "created": "<created date>",
            "created_by": "<created by id>",
            "modified": "<modified date>",
            "modified_by": "<modified by id>",
            "publish_up": "<publish up date>",
            "publish_down": "<publish down date>"
        },
        ...
        {
            "id": "<item id>",
            "name": "<item name>",
            "alias": "<item alias>",
            "created": "<created date>",
            "created_by": "<created by id>",
            "modified": "<modified date>",
            "modified_by": "<modified by id>",
            "publish_up": "<publish up date>",
            "publish_down": "<publish down date>"
        }
]
}

Notes

Created and modified date format is YYYY-MM-DD HH:MM:SS

 

Get an item

Request parameters

action=get
module=zoo
resource=items
id=<N>
app=<app id>

Example

<end-point>?action=get&module=zoo&resource=items&id=<N>&app=<A>

Example (REST format)

<end-point>/get/zoo/items/<N>=?app=<A>

Response

{
    "status": "ok",
    "id": "<item id>",
    "name": "<item name>",
    "alias": "<item alias>",
    "application_id": "<application id>",
    "type": "<item type>",
    "created": "<created date>",
    "created_by": "<created by id>",
    "modified": "<modified date>",
    "modified_by": "<modified by id>",
    "publish_up": "<publish up date>",
    "publish_down": "<publish down date>",
    "priority": "<item priority>",
    "state": "<item state>",
    "searchable": "<is searchable>",
    "access": "<item access>",
    "hits": <item hits>,
    "metadata_title": "<meta title>",
    "metadata_description": "<meta description>",
    "metadata_keywords": "<meta keywords>",
    "metadata_robots": "<meta robots>",
    "metadata_author": "<meta author>",
    "enable_comments": "<enable comments>",
    "primary_category": "<primary category id>",
    "elements": {
        "<element 1 id>": {
            "identifier": "<element 1 id>",
            "type": "<element type>",
            "data": {
                "<field 1 name>": "<field 1 value>",
                ...
                "<field M name>": "<field M value>"
            }
        },
        ...
        "<element N id>": {
            "identifier": "<element N id>",
            "type": "<element type>",
            "data": {
                "<field 1 name>": "<field 1 value>",
                ...
                "<field L name>": "<field L value>"
            }
        },
    }
}

Notes

Created and modified date format is YYYY-MM-DD HH:MM:SS

When option Identify elements is set to No, the elements structure is different:

    "elements": [
        {
            "identifier": "<element 1 id>",
            "type": "image",
            "data": {
                "<field 1 name>": "<field 1 value>",
                ...
                "<field M name>": "<field M value>"
            }
        },
        {
            "identifier": "<element N id>",
            "type": "textarea",
            "data": {
                "<field 1 name>": "<field 1 value>",
                ...
                "<field L name>": "<field L value>"
            }
        }
    ]

 

Plugin Settings

jBackend ZOO Plugin Settings

The following options are available for user plugin:

Option Description
Update hits Update hits counter for each request.
Identify elements Use field identifier as key to build the elements in the response.
Include elements Include elements data in the list of items.
Name elements Use a slug name for elements (in lowercase without blanks).
Monday, 21 July 2014 00:00

K2 Module API

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.

Get the list of categories

Request parameters

action=get
module=k2
resource=categories
rootid=<R> (optional)
endlevel=<E> (optional)

Example

<end-point>?action=get&module=k2&resource=categories&rootid=<R>&endlevel=<E>

Example (REST format)

<end-point>/get/k2/categories?rootid=<R>

Response

{
    "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>"
        }
    ]
}

Notes

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).

 

Get a category

Request parameters

action=get
module=k2
resource=categories
id=<N>

Example

<end-point>?action=get&module=k2&resource=categories&id=<N>

Example (REST format)

<end-point>/get/k2/categories/<N>

Response

{
    "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>"
}

Notes

Language can be "*" if any.

 

Get the list of items

Request parameters

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)

Example

<end-point>?action=get&module=k2&resource=items&cats=<C>&subs=1

Example (REST format)

<end-point>/get/k2/items?cats=<C>&limit=<L>&page=<P>

Response

{
    "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>"
        },
        ...
        {
            ...
        }
    ]
}

Notes

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

 

Get an item

Request parameters

action=get
module=k2
resource=items
id=<N>

Example

<end-point>?action=get&module=k2&resource=items&id=<N>

Example (REST format)

<end-point>/get/k2/items/<N>

Response

{
    "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>"
}

Notes

Created and modified date format is YYYY-MM-DD HH:MM:SS

Language can be "*" if any.

 

Plugin Settings

jBackend K2 Plugin Settings

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.