Wednesday, 11 November 2015 20:06

Devices

To access to the list of registered devices go to menu Components > jBackend > Devices. A list of mobile devices will be shown:

jBackend Devices

It is not possible to add or edit device manually. Device registration is performed through a request to the Push Module.

Each registered device has the following information:

Field:Description:
Token Device Token
App App code
Platform OS platform
IOS Alert App setting desired about alert on iOS (an optional registration param for the app)
IOS Badge App setting desired about badge on iOS (an optional registration param for the app)
IOS Sound App setting desired about sound on iOS (an optional registration param for the app)

In the current version alert, badge and sound fields are not used yet. They will be used in future, as example, to filter target devices for push notification sending.

For each device the following statistics fields are available:

Field:Description:
Hits Number of times the device has registered
Last visit Last time the device has registered
Push hits Number of push notifications sent to device
Last push Last time a push notification has been sent to device
Wednesday, 11 November 2015 20:05

Apps

To access to configured apps go to menu Components > jBackend > Apps. A list of mobile apps will be shown:

jBackend Apps

Each registered app has the following information:

Field: Description:
Code The application unique code (it will be converted in lowercase)
Description An arbitrary description for the application
Project ID Google Project ID
Project number Google Project number (it will be used as Sender ID)
API key Google API key
SSL certificate Apple SSL certificate
Password Password for Apple SSL certificate

SSL Certificate

The SSL certificate for APNs must be in PEM format, and must include the certificate and the private key. If the private key is not protected by password, the password field must be empty.

Here is an example of the PEM certificate:

-----BEGIN CERTIFICATE-----
MIIFjDCCBHSgAwIBAgIIAYymZoETLVYwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV
BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js
ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3
aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw
...
Nw2VqrNGWt42Jwt66015Ww+Toh5KaTisMJnR/UQsDOWErVUkmZBbrVkbIy/hhTYZ
b/MJRYBvnAQEtNU08eac3aqOEUFBt/Uu/HUigfvkxXOUdwMW4+wEB3uR2cLghrcA
XvVMho17NIY9rXy3bEIuzwDTUFoCOfBEBYqW00BJVTGkOa6EWDI7SZbuULtxlByD
4edJl4ukCdZrJaTfHWMPeGqnv+MIrxz6LNSeiulTyQw=
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,D20C57B1444E286C

uWXgF5I7fBBv2vY4N0yXiF9Uar+BRilhLUEuAcwDJJhWCFvnxVuBerck68Z5Zcbf
JNJlESBp7exD5sTgNfok12bRw9cXvhMibY70riCukfhJveSWXCYIgN9BYtUjZgdn
u8FZLtuRQH+HqY9OEjfQ9bcAiRX2a4uL1rKGCnyZShyWMRAtjLrOvT6Lzm8D59l6
7u8JcGlRAw+bdpDntwmB+17ep0zYd19uNRR5x9YKQfn9b55z1FiS+cBvwqqxnEtK
...
jNqc19lOabQjkmCPzJjUVeaR/7pco2pGhNoA9UpK9kgL82yuj4Vo/+VYbSw1a+/d
NkNKwOQTLttvKihEWDIZchoNP4vB/QnBo1DOAf+LRhtS3ja/FnLvsIouVeHo4OTL
NqJKpw2FLJUY2cxxfu0rVID6motRsSwR4vZ3RYoFf7lA9nQpWtaCDgxoohuFF4Jp
q+j5ZfY1MI0zQV56BnowR/0ocgzoibd6x3hTl076MGikjI6++Go6ng==
-----END RSA PRIVATE KEY-----
Monday, 09 November 2015 23:57

Push Module API

The Push Module is implemented with the plg_jbackend_push plugin. It provides functions related to mobile push notifications for iOS and Android. Here is the list of supported methods.

Register

The register function must be called by mobile apps each time they get a notification token from the push service (e.g. APNs or FCM) to register the device on jBackend. Registration is needed to send push notifications to the app on the registered device.

Request parameters

action=put
module=push
resource=register
token=<token>
appcode=<appcode>
platform=<platform>
user_id=<user_id> (optional)
user_email=<user_email> (optional)
ios_alert=<true or 1> (optional)
ios_badge=<true or 1> (optional)
ios_sound=<true or 1> (optional)

Example

<end-point>?action=put&module=push&resource=register&token=<token>&appcode=<appcode>&platform=ios

Example (REST format)

<end-point>/put/push/register?token=<token>&appcode=<appcode>&platform=android

Response

{
    "status": "ok",
    "token": "<token>",
    "appcode": "<appcode>",
    "platform": "<generic|android|ios>",
    "platform_code": <platform_code>,
    "app_id": "<app_id>",
    "device_id": <device_id>,
    "ios_alert": <0|1>,
    "ios_badge": <0|1>,
    "ios_sound": <0|1>
}

Notes

Supported platform codes are 0=Generic, 1=Android, 2=iOS.

It is possible to associate an existing Joomla user to the device with the user_id param. If the plugin option Require user email is enabled, it is also needed to include the user_email field, and the email must match with the registered email address for the user with the specified user_id.

On iOS platform the app can also send (optionally) its notification settings for alert (ios_alert), badge (ios_badge), and sound (ios_sound). These values can be used to filter target devices when sending push notifications from jBackend.

 

Scheduler

The scheduler function must be called on a regular basis (e.g. from a crontab) to trigger the sending of scheduled push notifications.

Request parameters

action=get
module=push
resource=scheduler

Example

<end-point>?action=get&module=push&resource=scheduler

Example (REST format)

<end-point>/get/push/scheduler

Response

{
    "status": "ok",
    "batch_size": <N>,
    "sent": <T>,
    "success": <S>,
    "failure": <F>
}

Notes

Sent is the total number of processed notifications.

 

Notifications

This function allows to create a push notification programmatically (i.e. add a notification to the queue).

Request parameters

action=post
module=push
resource=notifications
title=<title>
message=<message>
app_code=<app_code>
platform=<platform>
target=<target>
target_users=<target_users>
target_groups=<target_groups>
target_devices=<target_devices>
scheduled_time=<scheduled_time>
payload=<payload> (optional)
context=<context> (optional)
auth_token=<auth_token> (optional)

Example

<end-point>?action=post&module=push&resource=notifications&title=<title>&message=<message>&app_code=<code>&platform=1&target=0&scheduled_time=2016-11-13%2000:15:31

Example (REST format)

<end-point>/post/push/notifications?title=<title>&message=<message>&app_code=<code>&platform=1&target=0&scheduled_time=2016-11-13%2000:15:31

Response

{
    "status": "ok"
}

Notes

Supported platform codes are 0=Generic, 1=Android, 2=iOS.

Supported target codes are 0=All, 1=Selected users, 2=Selected groups, 3=Selected devices.

Params target_users, target_groups and target_devices are comma separated list of id.

Scheduled time format is YYYY-MM-DD HH:MM:SS (e.g. 2016-07-23 00:19:11).

Params payload and context can be a string or a json.

 

Plugin Settings

jBackend Push Plugin Settings jBackend Push Plugin Settings Android jBackend Push Plugin Settings iOS

The following options are available for push plugin:

Option Description
Auto app registration Allow automatic creation of new applications by code.
Require user email Require the user email to add the user id when register a device (as a security measure).
JSON Register Enable JSON payload on register action.
JSON Notifications Enable JSON payload on add notification action.
Protect Notifications Enable token protection on add notification action.
Authorization Token The token that enables the add notification action.
Batch size Number of push messages to send out each batch job.
Log notifications Enable logging of all notifications in a dedicated database table (useful for analytics purposes).
FCM URL URL of Firebase Cloud Messaging server.
API key Google API key.
Use FCM Use FCM to send push messages on iOS too.
APNs URL URL of Apple APNs server.
Timeout APNs connection timeout.
Tuesday, 21 July 2015 09:28

Menu Module API

The Menu Module is implemented with the plg_jbackend_menu plugin. It provides functions related to Joomla menus (com_menus). Here is the list of supported methods.

Get the list of menus

Request parameters

action=get
module=menu
resource=menus
limit=<L> (optional)
offset=<O> (optional)
orderby=<field> (optional)
orderdir=<dir> (optional)

Example

<end-point>?action=get&module=menu&resource=menus&limit=<L>&offset=<O>

Example (REST format)

<end-point>/get/menu/menus?limit=<L>

Response

{
    "status": "ok",
    "total": <total items>,
    "limit": <pagination limit>,
    "offset": <pagination offset>,
    "pages_current": <current page>,
    "pages_total": <total pages>,
    "menus": [
        {
            "id": "<menu id>",
            "menutype": "<menu type>",
            "title": "<menu title>",
            "description": "<menu description>",
            "count_published": "<total published>",
            "count_unpublished": "<total unpublished>",
            "count_trashed": "<total trashed>"
        },
        ...
        {
            "id": "<menu id>",
            "menutype": "<menu type>",
            "title": "<menu title>",
            "description": "<menu description>",
            "count_published": "<total published>",
            "count_unpublished": "<total unpublished>",
            "count_trashed": "<total trashed>"
        }
    ]
}

 

Get a menu

Request parameters

action=get
module=menu
resource=menus
id=<N>

Example

<end-point>?action=get&module=menu&resource=menus&id=<N>

Example (REST format)

<end-point>/get/menu/menus/<N>

Response

{
    "status": "ok",
    "id": "<menu id>",
    "menutype": "<menu type>",
    "title": "<menu title>",
    "description": "<menu description>"
}

 

Get the list of menu items

Request parameters

action=get
module=menu
resource=items
menutype=<menutype>
parentid=<R> (optional)
level=<E> (optional)
limit=<L> (optional)
offset=<O> (optional)
orderby=<field> (optional)
orderdir=<dir> (optional)

Example

<end-point>?action=get&module=menu&resource=items&menutype=<menutype>&orderby=<field>&orderby=<dir>

Example (REST format)

<end-point>/get/menu/items?menutype=<menutype>

Response

{
    "status": "ok",
    "total": <total items>,
    "limit": <pagination limit>,
    "offset": <pagination offset>,
    "pages_current": <current page>,
    "pages_total": <total pages>,
    items: [
        {
            "id": "<article id>",
            "menutype": "<menu type>",
            "title": "<title>",
            "alias": "<alias>",
            "note": "<note>",
            "path": "<path>",
            "link": "<link>",
            "type": "<type>",
            "parent_id": "<parent id>",
            "level": "<level>",
            "component_id": "<component id>",
            "browserNav": "<browserNav>",
            "access": "<access>",
            "img": "<img>",
            "template_style_id": "<template style id>",
            "home": "<home>",
            "language": "<language>",
            "client_id": "<client id>",
            "language_title": "<language title>",
            "image": "<image>",
            "componentname": "<component name>",
            "access_level": "<access level>",
            "name": "<component name>"
        },
        ...
        {
            ...
        }
    ]
}
Sunday, 05 April 2015 12:43

jBackend Custom Modules

If you need to integrate your Joomla site with another system or offer a service through a set of accessible API, jBackend is the right extension for you. jBackend can be extended with custom plugins to support any kind of extension and provide any kind of service. There is a detailed documentation which explains how to create your own modules. And if you are not a programmer you can HIRE US and get the job done right.

Reasons for success with us:

  • We have a long experience as system integrator;
  • We are a Joomla experts with a great reputation from the community;
  • We are cheap... really, prices from 20 euro;
  • And moreover, we are the creators of jBackend, so we know what we do.

How to get in touch with us:

To request a quote without engagement, This email address is being protected from spambots. You need JavaScript enabled to view it. or compile a request form, or access to Client Manager and create a new project request.

Published in Services
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).
Thursday, 16 October 2014 00:00

Logs

To access to end-points access logs go to menu Components > jBackend > Logs. A list of traced requests will be shown:

jBackend Logs

Each logged request has the following information:

Field:Description:
Endpoint The ID of the end-point that has received the request
Access type The type of access used on the end-point (free, user, API key)
Request time The date and time of the request
Duration Time required to serve the request (in seconds)
Error code The error code in case of request error
User ID The ID of the user when available
Key The API key used when available
Action The action of the request
Module The module of the request
Resource The resource of the request

It is possible to enable log trace for each end-point from the menu item options:

jBackend - Enable Trace

Thursday, 16 October 2014 00:00

Keys

To manage API Keys used to grant access to end-points go to menu Components > jBackend > Keys. A list of jBackend Keys will be shown:

jBackend Keys

Each key has the following properties:

Field: Description:
Key The enabling key
User The user associated to this key (to restrict access with key and to a single user)
Enabled endpoints If this key is enable on ALL endpoints or ONLY on selected endpoints
Selected endpoints The endpoints for which the key is enabled, when not enabled for ALL
Enabled on default If the key should also work on the default requests (i.e. /index.php?option=com_jbackend&view=request&...)
Daily requests Maximum number of daily requests allowed for the key (0 means unlimited)
Expiration date Key expiration date (0000-00-00 00:00:00 means never expires)
Comment Just a reminder for the key

For each key the following statistics fields are available:

Field: Description:
Hits Number of times the key was used
Last visit Last time the key was used
Current day Current day for daily requests limit
Current hits Hits of current day for daily requests limit

The API key, when required by the endpoint, must be included in any request using one of the following methods:

  • Adding api_key=<KEY> to the query params (for GET requests);
  • Adding api_key=<KEY> to the payload (for POST requests);
  • Adding api_key: <KEY> to the JSON payload (for JSON POST requests);
  • Adding Authorization: api_key <KEY> to the headers (in any case).
Friday, 26 September 2014 00:00

SobiPro Module API

The SobiPro Module is implemented with the plg_jbackend_sobipro plugin. It provides functions related to SobiPro directory extension (sections, categories and entries). Here is the list of supported methods.

Get the list of sections

Request parameters

action=get
module=sobipro
resource=sections

Example

<end-point>?action=get&module=sobipro&resource=sections

Example (REST format)

<end-point>/get/sobipro/sections

Response

{
    "status": "ok",
    "total": <T>,
    "sections": [
        {
            "id": "<section id>",
            "nid": "<section nid>",
            "name": "<section name>"
        },
        ...
        {
            "id": "<section id>",
            "nid": "<section nid>",
            "name": "<section name>"
        }
]}

 

Get a section

Request parameters

action=get
module=sobipro
resource=sections
id=<N>

Example

<end-point>?action=get&module=sobipro&resource=sections&id=<N>

Example (REST format)

<end-point>/get/sobipro/sections/<N>

Response

{
    "status": "ok",
    "id": "<section id>",
    "nid": "<section nid>",
    "name": "<section name>",
    "description": "<section description>",
    "owner": "<section owner id>",
    "counter": "<counter>",
    "createdTime": "<created time>",
    "updatedTime": "<updated time>",
    "metaDesc": "<meta description>",
    "metaKeys": "<meta keywords>",
    "metaAuthor": "<meta author>",
    "metaRobots": "<meta robots>",
    "version": "<version number>"
}

Notes

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

 

Get the list of categories

Request parameters

action=get
module=sobipro
resource=categories
parent=<N>

Example

<end-point>?action=get&module=sobipro&resource=categories&parent=<N>

Example (REST format)

<end-point>/get/sobipro/categories?parent=<N>

Response

{
    "status": "ok",
    "total": <T>,
    "categories": [
        {
            "id": "<category id>",
            "nid": "<category nid>",
            "name": "<category name>",
            "owner": "<owner id>",
            "counter": "<counter>",
            "createdTime": "<created time>",
            "updatedTime": "<updated time>",
            "metaDesc": "<meta description>",
            "metaKeys": "<meta keywords>",
            "metaAuthor": "<meta author>",
            "metaRobots": "<meta robots>",
            "version": "<version number>"
        },
        ...
        {
            "id": "<category id>",
            "nid": "<category nid>",
            "name": "<category name>",
            "owner": "<owner id>",
            "counter": "<counter>",
            "createdTime": "<created time>",
            "updatedTime": "<updated time>",
            "metaDesc": "<meta description>",
            "metaKeys": "<meta keywords>",
            "metaAuthor": "<meta author>",
            "metaRobots": "<meta robots>",
            "version": "<version number>"
        }
]}

Notes

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

 

Get a category

Request parameters

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

Example

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

Example (REST format)

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

Response

{
    "status": "ok",
    "id": "<category id>",
    "nid": "<category nid>",
    "name": "<category name>",
    "description": "<category description>",
    "owner": "<category owner id>",
    "counter": "<counter>",
    "createdTime": "<created time>",
    "updatedTime": "<updated time>",
    "metaDesc": "<meta description>",
    "metaKeys": "<meta keywords>",
    "metaAuthor": "<meta author>",
    "metaRobots": "<meta robots>",
    "version": "<version number>",
    "parent": "<parent id>"
}

Notes

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

 

Get the list of entries

Request parameters

action=get
module=sobipro
resource=entries
category=<C>

Example

<end-point>?action=get&module=sobipro&resource=entries&category=<C>

Example (REST format)

<end-point>/get/sobipro/entries?category=<C>

Response

{
    "status": "ok",
    "total": <T>,
    "entries": [
        {
            "id": "<entry id>",
            "nid": "<entry nid>",
            "name": "<entry name>",
            "owner": "<owner id>",
            "counter": "<counter>",
            "createdTime": "<created time>",
            "updatedTime": "<updated time>",
            "metaDesc": "<meta description>",
            "metaKeys": "<meta keywords>",
            "metaAuthor": "<meta author>",
            "metaRobots": "<meta robots>",
            "version": "<version number>"
        },
        ...
        {
            "id": "<entry id>",
            "nid": "<entry nid>",
            "name": "<entry name>",
            "owner": "<owner id>",
            "counter": "<counter>",
            "createdTime": "<created time>",
            "updatedTime": "<updated time>",
            "metaDesc": "<meta description>",
            "metaKeys": "<meta keywords>",
            "metaAuthor": "<meta author>",
            "metaRobots": "<meta robots>",
            "version": "<version number>"
        }
]}

Notes

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

 

Get an entry

Request parameters

action=get
module=sobipro
resource=entries
id=<N>

Example

<end-point>?action=get&module=sobipro&resource=entries&id=<N>

Example (REST format)

<end-point>/get/sobipro/entries/<N>

Response

{
    "status": "ok",
    "id": "<entry id>",
    "nid": "<entry nid>",
    "name": "<entry name>",
    "owner": "<entry owner id>",
    "section": "<entry section id>",
    "counter": "<counter>",
    "createdTime": "<created time>",
    "updatedTime": "<updated time>",
    "metaDesc": "<meta description>",
    "metaKeys": "<meta keywords>",
    "metaAuthor": "<meta author>",
    "metaRobots": "<meta robots>",
    "version": "<version number>",
    "fields": [
        {
            "name": "<field name>",
            "fid": "<field id>",
            "nid": "<field nid>",
            "sid": "<field sid>",
            "section": "<section id>",
            "lang": "<language code>",
            "_data": "<field data>",
            "_rawData": "<field raw data>",
            "fieldType": "<field type>",
            "isFree": "<is free>",
            "position": "<position>"
        },
        ...
        {
            "name": "<field name>",
            "fid": "<field id>",
            "nid": "<field nid>",
            "sid": "<field sid>",
            "section": "<section id>",
            "lang": "<language code>",
            "_data": "<field data>",
            "_rawData": "<field raw data>",
            "fieldType": "<field type>",
            "isFree": "<is free>",
            "position": "<position>"
        }
]}

Notes

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

 

Plugin Settings

jBackend SobiPro Plugin Settings

The following options are available for user plugin:

Option Description
JSON Entries Enable JSON payload on entries action.
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.
Page 2 of 4