Monday, 25 September 2017 23:40

Release System Module API

The Release System Module is implemented with the plg_jbackend_release plugin. It provides functions to implement a full Joomla Update Server and/or a generic Package Distribution System based on Joomla. It supports both free and paid packages, and it is seamlessly integrated with Joomla user's groups for authorization and license key generation. Here is the list of supported methods.

Generate key by email

Sends an email to the user with the license key for the specified package group.

Request parameters

action=post
module=release
resource=keybyemail
id=<package group>
email=<user email>

Example

<end-point>?action=post&module=release&resource=keybyemail&id=redj_ent&email=This email address is being protected from spambots. You need JavaScript enabled to view it.

Example (REST format)

<end-point>/post/release/keybyemail/redj_ent?email=This email address is being protected from spambots. You need JavaScript enabled to view it.

Response

{
    "status": "ok"
}

Notes

email is the user's account email on Joomla.

 

Generate key by authentication

Returns the license key for the specified package group.

Request parameters

action=post
module=release
resource=keybyauth
id=<package group>
username=<username>
password=<password>

Example

<end-point>?action=post&module=release&resource=keybyauth&id=redj_ent&username=user123&password=pass123

Example (REST format)

<end-point>/post/release/keybyauth/redj_ent?username=user123&password=pass123

Response

{
    "status": "ok",
    "email": "user email",
    "key": "license key"
}

Notes

username and password are the credentials used for the user's account on Joomla.

 

Validate key

Checks if a license key is valid for the specified package group.

Request parameters

action=post
module=release
resource=validate
id=<package group>
email=<user email>
key=<license key>

Example

<end-point>?action=post&module=release&resource=validate&id=redj_ent&email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323

Example (REST format)

<end-point>/post/release/validate/redj_ent?email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323

Response

{
    "status": "ok"
}

 

Verify key

Checks if a license key is valid for the specified package id.

Request parameters

action=post
module=release
resource=verify
id=<package id>
email=<user email>
key=<license key>

Example

<end-point>?action=post&module=release&resource=verify&id=redj_ent_190&email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323

Example (REST format)

<end-point>/post/release/verify/redj_ent_190?email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323

Response

{
    "status": "ok"
}

Notes

This method is intended to verify a license key over a specific package id before to download it.

 

Download package

Download the package for the specified package id.

Request parameters

action=post
module=release
resource=download
id=<package id>
email=<user email>
key=<license key>

Example

<end-point>?action=post&module=release&resource=download&id=redj_ent_190&email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323

Example (REST format)

<end-point>/post/release/verify/redj_ent_190?email=This email address is being protected from spambots. You need JavaScript enabled to view it.&key=fd8s809f89ds8f90sd81231sdsds323

Response

The binary package (as application/octet-stream)

 

Plugin Settings

jBackend Release System Plugin Settings

The following options are available for release system plugin:

Option Description
Folder Packages distribution folder path relative to Joomla root folder (JPATH_ROOT).
Package groups List of package groups. Packages in the same group share the same license key. Format is 'package group;groups[;hash;package name]' where package group is an unique identifier (e.g. redj_enterprise), groups is a list of user groups allowed to download packages in this group separated by commas (e.g. 1,3,5), hash is an optional random string used as seed for the generation of group's license keys, and package name is the human readable name of the package (e.g. ReDJ Enterprise).
Packages List of packages to distribute. Format is 'package id;package path[;package group]' where package id is an unique identifier (e.g. redj_ent_190), package path is the path of the package file relative to the packages distribution folder (e.g. private/joomla/redj/ReDJ1.9.0.zip), and package group is the group identifier (optional, not required for free downloads).

Since version 1.6 Joomla has an Update System that allows you to update installed extensions automatically. And since January 10th 2017 supporting this system is almost mandatory for each extension.

Published in Newsblog
Monday, 25 September 2017 23:13

jBackend Release System

jBackend Release System is a jBackend module that provides all features to implement a full Joomla Update Server and/or a generic Package Distribution System based on Joomla. It works with both jBackend and jBackend Community.

It can be used to distribute free packages, and paid packages as well. For paid packages the download restrictions are based on license keys, that are automatically generated and securely distributed to licensed users, authorized thorugh Joomla user's groups. Technical documentation is available here. An article that describes how it works can be found here.

Features

  • Configurable packages distribution folder;
  • Free and access restricted package distribution;
  • Multiple package groups (releases in the same group share the license key);
  • Multiple user groups can be enabled for each package group;
  • Multiple package releases for each package group;
  • Secret hash for each package group (increase security for generated license keys);
  • Really lite (less than 700 lines of code).

 

jBackend Release System

 

jBackend Release System is released under GPL 2.0 license.

Buy Subscription to jBackend Release System

Published in Products
Monday, 15 May 2017 18:21

Community Builder Module API

This module is only available with the Premium Subscription.
This module is intended for B2B integration. It exposes data that should not be made available on a public endpoint, so it must be used only on a private endpoint and somehow protected (e.g. through an API key).

The Community Builder Module is implemented with the plg_jbackend_comprofiler plugin. It provides functions related to Community Builder extension. Here is the list of supported methods.

List users

Request parameters

action=get
module=comprofiler
resource=users
limit=<L> (optional)
offset=<O> (optional)

Example

<end-point>?action=get&module=comprofiler&resource=users

Example (REST format)

<end-point>/get/comprofiler/users?limit=10&offset=2

Response

{
    "status": "ok",
    "total": <total>,
    "limit": <limit>,
    "offset": <offset>,
    "users": [
        {
            "id": "<userid>",
            ...
        },
        ...
        {
            "id": "<userid>",
            ...
        }
    ]
}

Notes

limit is the number of entries to return.

offset is the cursor starting point (0 based, start on record 16 means offset = 15).

If limit is not specified, offset is ignored.

Properties limit and offset in the response are present only when specified in the request.

 

Get user profile

Request parameters

action=get
module=comprofiler
resource=profile
id=<id>

Example

<end-point>?action=get&module=comprofiler&resource=profile&id=482

Example (REST format)

<end-point>/get/comprofiler/profile/482

Response

{
    "status": "ok",
    ...
}

 

Update user profile

Request parameters

action=put
module=comprofiler
resource=profile

 

JSON payload data

{
    "id": "<userid>",
    "name": "<name>",
    "username": "<username>",
    "email": "<email>",
    "password": "<password>",
    ...
}

Example

<end-point>?action=put&module=comprofiler&resource=profile

Example (REST format)

<end-point>/put/comprofiler/profile

Response

{
    "status": "ok"
}

Notes

The id parameter in the request payload is mandatory to identify the user profile to update.

Other mandatory fields are username, email, and name.

It is possible to specify any supported field in the payload.

 

Monday, 15 May 2017 09:53

Search Module API

This module is only available with the Premium Subscription.

The Search Module is implemented with the plg_jbackend_search plugin. It provides functions related to Joomla search module. Here is the list of supported methods.

Search site

Request parameters

action=get
module=search
resource=site
searchword=<term>
searchphrase=<all> (optional)
limitstart=<offset> (optional)
limit=<limit> (optional)
ordering=<orderby> (optional)
areas[]=<area> (optional)

Example

<end-point>?action=get&module=search&resource=site?searchword=joomla&searchphrase=all&limitstart=10&limit=10&ordering=newest&areas[]=content

Example (REST format)

<end-point>/get/search/site?searchword=<term>

Response

{
    "status": "ok",
    "total": <T>,
    "limit": <L>,
    "offset": <O>,
    "pages_current": <C>,
    "pages_total": <P>,
    "results": [
        {
            "title": "<title>",
            "metadesc": "<metadesc>",
            "metakey": "<metakey>",
            "created": "<date created>",
            "language": "<language>",
            "catid": "<cid>",
            "text": "<text>",
            "section": "<section>",
            "slug": "<id:slug>",
            "catslug": "<id:slug>",
            "browsernav": "<browsernav>",
            "href": "<href>",
            "jcfields": "<jcfields>"
        },
        ...
    ]
}

Notes

searchphrase:
any, exact, all (default)

ordering:
newest (default), oldest, popular, alpha, category

areas:
an array of search areas (e.g. content)

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

Language can be "*" if any.

 

Monday, 07 November 2016 23:47

jBackend Community

jBackend Community is the lite version of jBackend available for free, no subscription required. It provides all the basic features to integrate Joomla content with mobile apps, syndication networks, affiliate networks and any external system, and it is mainly intended to give a chance to test jBackend capabilities, to develop and test new modules, and to provide some basic REST API integration features to a Joomla site.

When the upgrade to the full jBackend version is required, it is possible to install the full jBackend package over the Community version. The two versions share the same data tables and settings, and the upgrade process will preserve the configuration and all existing data.

The Community version is completely free, but doesn't provide the full functionalities available for jBackend. Here's a comparison matrix between jBackend Community and jBackend:

 

Features jBackend Community jBackend
Extensible through plugins to increase API and support any Joomla extension Yes
(2 plugins in the package)
Yes
(3 plugins in the package, 7+ included
with the subscription)
Support for publishing of multiple endpoints, each with its specific settings Yes Yes
Three endpoint access type (free access, user authenticated only, API Key required) No
(free only)
Yes
Tracing requests in the database for each endpoint Yes Yes
Selection of jBackend plugins to enable for each endpoint Yes Yes
API Key management interface No
(not used)
Yes
Request log management interface Yes Yes
Each API Key can have a max daily requests limit and an expiration date No
(not used)
Yes
Each API Key can be targeted on separate endpoints No
(not used)
Yes
Access control is compliant with integrated ACL No
(not used)
Yes
Support for REST compliant requests Yes Yes
JSON format for responses Yes Yes
Support for session ID No
(only cookies)
Yes
Get the list of articles by tag id (content module) No Yes
Support for push notifications on iOS (APNs) and Android (GCM) No Yes
Custom payload for push notifications No Yes
Scheduled sending of push notifications No Yes
Push notifications can be create and scheduled via API call No Yes
Push notifications can be targeted on selected users, groups or devices No Yes
License GPL 2.0 GPL 2.0
Price Free 14 € (one year subscription)
  Download jBackend Community Buy Subscription to jBackend

The basic extension package includes the jBackend component, that provides the general infrastructure for endpoints, and plugins support system. Also the following plugins are already included in the basic package:

  • User Module: provides support for Joomla users (e.g. login, logout, registration);
  • Content Module: provides support for standard Joomla content (e.g. categories and articles);

Additional plugins are available only with a valid jBackend Subscription and can be downloaded from here and installed separately. More info about jBackend can be found here

jBackend Community is released under GPL 2.0 license.

Published in Products
Saturday, 07 May 2016 11:37

Kunena Module API

The Kunena Module is implemented with the plg_jbackend_kunena plugin. It provides functions related to Kunena forum for Joomla (topics and categories). Here is the list of supported methods.

Get the list of categories

Request parameters

action=get
module=kunena
resource=categories
parentid=<P> (optional) default to the root
levels=<L> (optional) 0=all levels, default is 1
unpublished=<0|1> (optional) 0=Hide (default), 1=Show

Example

<end-point>?action=get&module=kunena&resource=categories&parentid=<P>&levels=<L>

Example (REST format)

<end-point>/get/kunena/categories?parentid=<P>

Response

{
    "status": "ok",
    "categories": [
        {
            "id": "<category id>",
            "name": "<category name>",
            "alias": "<category alias>",
            "description": "<category description>",
            "parent_id": "<parent category id>",
            "level": "<category level>",
            "numTopics": "<number of category topics>",
            "numPosts": "<number of category posts>",
            "hits": "<number of hits>"
        }
    ]
}

 

Get a category

Request parameters

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

Example

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

Example (REST format)

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

Response

{
    "status": "ok",
    "id": "<category id>",
    "name": "<category name>",
    "alias": "<category alias>",
    "description": "<category description>",
    "parent_id": "<category parent id>",
    "level": "<category language>",
    "numTopics": "<number of category topics>",
    "numPosts": "<number of category posts>",
    "hits": "<number of hits>",
    "icon": "<category icon>",
    "icon_id": "<category icon id>",
    "locked": "<locked status>",
    "pub_access": "<public access>",
    "pub_recurse": "<public recurse>",
    "review": "<review>",
    "allow_anonymous": "<allow anonymous>",
    "post_anonymous": "<post anonymous>",
    "allow_polls": "<allow polls>",
    "topic_ordering": "<topic ordering>",
    "last_topic_id": "<last topic id>",
    "last_post_id": "<last post id>",
    "last_post_time": "<last post time>"
}

 

Get the list of topics

Request parameters

action=get
module=kunena
resource=topics
catid=<C>
limit=<L> (optional)
offset=<O> (optional)
orderdir=<dir> (optional) asc, desc

Example

<end-point>?action=get&module=kunena&resource=topics&catid=<C>

Example (REST format)

<end-point>/get/kunena/topics?catid=<C>

Response

{
    "status": "ok",
    "total": "<total items>",
    "limit": <pagination limit>,
    "offset": <pagination offset>,
    "topics": [
        {
          "id": "<topic id>",
          "category_id": "<category id>",
          "subject": "<topic subject>",
          "locked": "<locked>",
          "hold": "<hold>",
          "posts": "<posts>",
          "hits": "<number of hits>",
          "attachments": "<attachments>",
          "first_post_id": "<first post id>",
          "first_post_time": "<first post time>",
          "first_post_userid": "<first post user id>",
          "first_post_message": "<first post message text>",
          "first_post_guest_name": "<first post guest name>",
          "last_post_id": "<last post id>",
          "last_post_time": "<last post time>",
          "last_post_userid": "<last post user id>",
          "last_post_message": "<last post message text>",
          "last_post_guest_name": "<last post guest name>"
        },
        ...
        {
        }
    ]
}

 

Get a topic

Request parameters

action=get
module=kunena
resource=topics
id=<N>

Example

<end-point>?action=get&module=kunena&resource=topics&id=<N>

Example (REST format)

<end-point>/get/kunena/topics/<N>

Response

{
  "status": "ok",
  "id": <topic id>,
  "category_id": "<category id>",
  "subject": "<subject>",
  "locked": "<locked>",
  "hold": "<hold>",
  "posts": "<posts>",
  "hits": "<number of hits>",
  "attachments": "<attachments>",
  "first_post_id": "<first post id>",
  "first_post_time": "<first post time>",
  "first_post_userid": "<first post user id>",
  "first_post_message": "<first post text message>",
  "first_post_guest_name": "<first post guest name>",
  "last_post_id": "<last post id>",
  "last_post_time": "<last post time>",
  "last_post_userid": "<last post user id>",
  "last_post_message": "<last post text message>",
  "last_post_guest_name": "<last post guest name>",
  "messages": [
    {
      "id": "<message id>",
      "parent": "<parent id>",
      "thread": "<thread id>",
      "catid": "<category id>",
      "name": "<user name>",
      "userid": "<user id>",
      "email": "<email>",
      "subject": "<message subject>",
      "time": "<message time>",
      "ip": "<ip address>",
      "topic_emoticon": "<topic emoticon>",
      "locked": "<locked>",
      "hold": "<hold>",
      "hits": "<number of hits>",
      "message": "<message>",
      "replynum": <number of replies>,
      "thankyou": [
        ...
      ]
    },
    ...
    {
        ...
    }
  ]
}

Since version 3, jBackend  introduced support for push notifications for Android and iOS, providing all needed functions to manage multiple mobile apps, to register devices and to send scheduled push notifications. The following video shows how to use jBackend to create a new application, to call the push register service to register a device, and the schedule and trigger a push notification.

Published in Newsblog
Wednesday, 11 November 2015 20:06

Notifications

To access to configured notifications go to menu Components > jBackend > Notifications. A list of notifications will be shown:

jBackend Notifications

Each notification has the following information:

Field: Description:
Title Notification title (used only on Android)
Message Notification message
Payload Payload of push notification for app (JSON format)
App App code
Platform OS platform
Target Target registered devices for the push notification (All, Selected users, Selected groups, Selected devices)
Target Users Users whose registered devices are target for the push notification
Target Groups Groups whose registered devices are target for the push notification
Target Devices Registerd devices target of the push notification
Context Application specific notification context. Not used yet (it will be used to filter recipients for push notifications)
Scheduled time Time scheduled to start sending out this notification on devices
Status Current sending status for this notification
Last run Last time this notification queue has been executed
Last device ID Device ID of the last notification sent in the last run

The Status of a notification can be:

Status: Description:
aborted (-2) The notification is "logically" deleted (in this state the notification is always skipped)
paused (-1) The notification is suspended (in this state the notification is always skipped)
scheduled (0) The notification is ready to be sent (sending will start at the scheduled time)
running (1) The notification is currently being processed
completed (2) The notification has been sent to all devices (job completed)

Using the buttons on the toolbar it is possible to change the status of selected notifications. It is also possible to "unlock" locked notifications. It could be useful, as example, when a notification is locked for too long, which could mean there was a problem on the scheduler and the resource was not released properly (see How notification sending works)

Since jBackend 3.3.0 each notification sent is logged into a database table. A management interface to access these logs will be provided in the next future.

How notification sending works

To start processing the pending notifications (with status scheduled and running) it is necessary to call a "trigger" function. The Push Module has a scheduler function that must be called on a regular basis (e.g. from a crontab) to trigger the sending of scheduled push notifications.

Scheduler logic

Each time the scheduler function is called, it select all pending notifications ordered by the scheduler time ascending (first the notification scheduled before). To be "pending" a notification must have a scheduled time less then current time, must be in status scheduled or running, and must be no locked (locked means the notification is currently in charge of another scheduler). If the pending list is not empty, the scheduler starts to process notifications once a time, until the total number of push notifications sent to devices reach the Batch size (max configured for the scheduler).

For the notification currently being processed, the scheduler first locks it, then start to send the notifications to all matching devices (sorted by device ID, so all devices will be checked only once, including new devices added while the notification is running) until the Batch size is reached or the devices are finished. In the first case the notification is unlocked and the scheduler ends. In the second case the notification state is set to completed, it is unlocked and the scheduler starts to process the next notification (if one) with the same rules.

With this processing logic it is possible to schedule and execute concurrent schedulers to increase volume of push notifications sent.

Push notification payload

It is possible to send a custom payload with each push notification. The payload must be a valid JSON, example:

{
  "alert": {
    "alertId": "1404999843555",
    "alertStatus": false
  }
}

Or:

{
  "id": "25"
}

How to get the JSON payload in the mobile app depends on the framework used. The following is an example using Ionic Framework with this Cordova Push notification plugin:

https://github.com/phonegap-build/PushPlugin

Android GCM

In the jBackend push plugin the payload hasthe following structure:

    $payload = array(
      'title'      => $notification['title'],
      'message'    => $notification['message'],
      'icon'       => 'icon',
      'data'       => $notification['payload']
    );

On the mobile app the push callback has the following code:

    window.onNotificationGCM = function(e) {
        switch (e.event) {
            case 'registered':
                if (e.regid.length > 0) {
                    $rootScope.$emit('push.registered', { 'token': e.regid });
                }
                break;
            case 'message':
                // Notification in foreground
                if (e.foreground) {
                    $log.debug('push notification in foreground');
                } else {
                    $log.debug('push notification in background');
                }
                $log.debug('push message payload ' + JSON.stringify(e.payload));
                $rootScope.$emit('push.received', { 'payload': e.payload.data });
                // e.payload.data is { "id": "25" }
                break;
            case 'error':
                $log.debug('push GCM error ' + e.msg);
                break;
            default:
                $log.debug('push GCM unknown event');
                break;
        }
    };

Apple APNs

In the jBackend push plugin the payload hasthe following structure:

    $body = array(
      'aps' => array(
          'alert' => array(
              'title' => $notification['title'],
              'body' => $notification['message']
          ),
          'sound' => 'default'
      ),
      'data' => $notification['payload']
    );

On the mobile app the push callback has the following code:

    window.onNotificationAPN = function(e) {
        if (e.alert) {
            $log.debug('push APN alert ' + e.alert);
        }
        if (e.sound) {
            $log.debug('push APN sound');
        }
        if (e.badge) {
            $log.debug('push APN badge ' + e.badge);
            pushNotification.setApplicationIconBadgeNumber(successBadgeHandler, errorBadgeHandler, e.badge);
        }
        $log.debug('push APN full event ' + JSON.stringify(e));
        $rootScope.$emit('push.received', JSON.parse(e.data));
        // e.data is { "id": "25" }
    };
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
Page 1 of 4