External API

There are two ways to develop your own interface for interacting with application. The first way is to create a full featured Areto Framework module. It allows you to integrate into the system at the lowest level. See an example of such an implementation.

The second way is access to the application functionality using an external API. It allows you to create and place modules both together and separately from the application server. See an example of such an implementation.

External API

Client script sends an AJAX request to the server and processes received data. If the data requires authorized access, then client must first enter the system. All unauthenticated requests will be assigned the guest role..

To allow guests to see articles, add Read meta-permission for publicList and publicView of the article class. Remember to restart security after this changes.

List objects
jQuery.post('/api/document/data/list', {
    class: 'article',
    view: 'publicList',
    start: 0,
    length: 10
}).done(data => {});
Read object
jQuery.post('/api/document/data/read', {
    class: 'article',
    view: 'publicView',
    id: '5e1ffece8887001d74fc9df3'
}).done(data => {});
Create object
jQuery.post('/api/document/data/create', {
    class: 'someClass',
    view: 'someView',
    data: {
        someAttrName: 'someValue'
    }
}).done(id => {});
Update object
jQuery.post('/api/document/data/update', {
    class: 'someClass',
    view: 'someView',
    id: 'someObjectId',
    data: {
        someAttrName: 'someValue'
    }
}).done(id => {});
Delete object
jQuery.post('/api/document/data/delete', {
    class: 'someClass',
    view: 'someView',
    id: 'someObjectId'
}).done(id => {});