List all methods of REST API and explain the API functionality
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.eyJzdWIiOiJkbXBzeXN0ZW0iLCJjbGllbnRJZCI6ImFiYyIsImV4cCI6MTUxMTIyNzAxNCwiaXNzIjoiY29tLmF2YWxhbnQuand0In0.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.