List of Methods


Login

Before calling any other API, client should login to ONEWEB because of security reasons. This App Runtime API is implemented using JWT. The application server is configured to verify that the incoming JWT are created by the authentication server. For example of client request see below


URL: http://[SERVER]:[PORT]/eaf-rest/login

HTTP Method: POST

HTTP Request Header: Content-Type : application/json

HTTP Request:        {

                         "username" : [String: User Name],

                         "password" : [String: Password],

                         "ldapproviderurl" : [String: Empty value],

                         "clientId" : [String: key generate from client Ex. "93370c42-0d98-40ca-9a3d-36917a758b04"]

}

HTTP Response: {

                           "timestamp": [String: timestamp value Ex. "1510363014419"],

                           "validity": [Long: validity value Ex. 86400],

                           "id_token": [String: token value Ex. "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJkbXBzeXN0ZW0iLCJjbGllbnRJZCI6ImFiYyIsImV4cCI6MT

                                                    UxMTIyNzAxNCwiaXNzIjoiY29tLmF2YWxhbnQuand0In0.UXR5LbqWruWy3rJur2Lx2E1nfI73JX3QBQXA4c2u2_

                                                    CTSSzceRRMyziGevhtRe16AzAgZGKhny3PdfNltIT5Hw"]

}


Search Entity

This API is used to search data from database by specific entity id and search parameter.


URL: http://[SERVER]:[PORT]/eaf-rest/entity/[Entity ID]/search?handleForm=Y&page=1&volumePerPage=10&cbMethod=searchHandler

HTTP Method: GET

HTTP Request Header: Content-Type : application/json, Authorization : "Bearer "+[Token], clientId : [Key generate from client]

HTTP Request: n/a

HTTP Response:searchHandler({

"ALL_VOLUME":"[Number of Record]",

"DATA":[{

"[Column Name 1]":"[Column Value 1]"

"[Column Name 2]":"[Column Value 2]"

..

"[Column Name n]":"[Column Value n]"

"KEY":{"ID":"[Key Value]"}

}]

});


Get Entity

After user uses search API, user can select a record to view detail. This API will return all information from database by entity id then user can edit, update or delete data on screen.


URL: http://[SERVER]:[PORT]/eaf-rest/entity/[Entity ID]/get?ID=[Key ID]&cbMethod=getRecordHandler

HTTP Method: GET

HTTP Request Header: Content-Type : application/json, Authorization : "Bearer "+[Token], clientId : [Key generate from client]

HTTP Request: n/a

HTTP Response: getRecordHandler({

"DATA":{

"ENTITY_ID":"[Entity ID]",

"MODULE_ID":{"[Module ID]":[{

                       "UPDATE":{

                               "[Table Name]":{

                                       "[Column Name 1]":"Column Value 1",

                                       "[Column Name 2]":"Column Value 2",

                                       ..

                                       "[Column Name n]":"Column Value n",

                                       "KEY":{"Key Column Name 1":"[Key Value 1]","Key Column Name":"[Key Value]"}

                               }

                       }

               }]},

"MAIN_KEYTAB":{"MainTab Key Column Name":"[Key Value]"}

}

});


Save Entity

This API is used to insert data to database. After user enter new data on screen and click save button.


URL: http://[SERVER]:[PORT]/eaf-rest/entity/[Entity ID]/save?handleForm=Y&cbMethod=saveSuccessHandler

HTTP Method: POST

HTTP Request Header: Content-Type : application/json, Authorization : "Bearer "+[Token], clientId : [Key generate from client]

HTTP Request: {

                 "[Module ID]": [{

                             "INSERT": {

                                       "[Table Name]": {

               "[Column Name 1]": "[Value 1]",

                                                 "[Column Name 2]": "[Value 2]",

                                                 ..

                                                 "[Column Name n]": "[Value n]"

                                               }

                                     }

                           }]

}

HTTP Response: saveSuccessHandler({"MESSAGE":"Ok Save.","STATUS":"Success.","[Key Column Name]":"[Key Value]"});


Update Entity

This API send update data to database after user edit data on screen.


HTTP Method: POST

HTTP URL: http://[SERVER]:[PORT]/eaf-rest/entity/[Entity ID]/save?handleForm=Y&cbMethod=saveSuccessHandler

HTTP Header: Content-Type : application/json, Authorization : "Bearer "+[Token], clientId : [Key generate from client]

HTTP Request: {

                 "[Module ID]": [{

                             "UPDATE": {

                                       "[Table Name]": {

               "[Column Name 1]": "[Value 1]",

                                                 "[Column Name 2]": "[Value 2]",

                                                 ..

                                                 "[Column Name n]": "[Value n]"

                                               }

                                     }

                           }]

}

HTTP Response: saveSuccessHandler({"MESSAGE":"Ok Save.","STATUS":"Success.","[Key Column Name]":"[Key Value]"});


Delete Entity

HTTP Method: POST

HTTP URL: http://[SERVER]:[PORT]/eaf-rest/entity/[Entity ID]/get?handleForm=Y&cbMethod=searchHandler&ID=[Primary key]

HTTP Header: Content-Type : application/json, Authorization : "Bearer "+[Token], clientId : [Key generate from client]

HTTP Request:

HTTP Response:


Upload File

HTTP Method: POST

HTTP URL: http://[SERVER]:[PORT]/eaf-rest/entity/[Entity ID]/get?handleForm=Y&cbMethod=searchHandler&ID=[Primary key]

HTTP Header: Content-Type : application/json, Authorization : "Bearer "+[Token], clientId : [Key generate from client]

HTTP Request: [form-data]

HTTP Response:


Download File

HTTP Method: GET

HTTP URL: http://[SERVER]:[PORT]/eaf-rest/file/[File ID]/download?mimetype=[Mimetype]

HTTP Header: Content-Type : application/json, Authorization : "Bearer "+[Token], clientId : [Key generate from client]

HTTP Request: n/a

HTTP Response: [Object File]


Note: Mimetype has two option "application/octet-stream","application/base64"