By utilizing the REST API, you can connect Wagby with any client (front end application).
The Wagby application supports the REST API as standard.
When a developer sends an HTTP request to the server (host) on which the Wagby application is running, it can acquire the result in the JSON format.
Using this mechanism, it is possible to perform database operations such as acquisition, registration, update, and deletion of data stored in Wagby from a dedicated front-end application using HTTP request.It can be accessed not only from PC but also from iOS and Android OS.
It shows a typical API.Details are listed on each page.
|/rest/session||GET||Retrieve logon user information|
|/rest/[model name]/list||GET||Obtain list display data|
|/rest/[model name]/list||POST||Specify search conditions to acquire data|
|/rest/[model name]/entry/[primary key]||GET||Retrieve the data specified with the primary key|
|/rest/[model name]/new||GET||Start new registration of data|
|/rest/[model name]/new||POST||Execute new registration of data|
|/rest/[model name]/edit/[primary key]||GET||Start updating the data specified by the primary key|
|/rest/[model name]/edit/[primary key]||PUT||Perform data update specified by primary key|
|/rest/[model name]/edit/[primary key]||DELETE||Delete data specified with primary key|
In this guide, we use the notation called RequestMapping.
Indicates that you want to access with.
produces="application/json"in the HTTP header
Indicates that you want to set.
Even when using the REST API, there is a danger that logon information and data will be eavesdropped unless the communication path is encrypted, as with ordinary web applications.
For this reason, please use HTTP encrypted communication (HTTPS) in actual operation.Specifically, I will purchase a "server certificate".Since the Wagby application is based on Tomcat, it can be set by the same procedure as registering a server certificate to Tomcat.(For details, please contact the publisher of "server certificate" or Wagby sales partner.)
There are two versions of the REST API.
It is a format up to R 7.10.3.The key name of JSON object is Camel Case format.
For example, for item name "user_address", the key name of the JSON object is "userAddress".
It was added in R 7.11.Output the key name of the JSON object from CamelCase format and the item name as it is.
For example, for item name "user_address", the key name of the JSON object is also "user_address".
In Wagby after R7.11, the standard is "version 2".If you use "version 1" for some reason, please do the following.
"REST API Version" of "Environment> Customize> Details" is set to "v1".When it is blank, it becomes v2.The default is blank (v2).
Let "REST API Version" of "Screen> Other> REST" be "v1".When it is blank, it becomes v2.The default is blank (v2).
You can specify the HTTP header X - Wagby - RESTAPIVersion: v1 when using the REST API.In this case, even if the REST API Version of the model is v2, v1 can only be used for this access.If you need to use v1 but you do not want to change the model definitions, please use this method.
The portlet and modern calendar view internally use the REST API, but after R7.11 we only handle v2.(It is not possible to return to v1.)
It can not be used for customization such as calling REST API together with Wagby screen processing.
Active Directory and Open LDAP etc authenticate via CAS.The REST API does not support this CAS authentication.(It is planned to correspond in the future Wagby.Please wait for a while.)