Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
The JSON API in a process enables one to issue a JSON web service call, and to save the returned data into Joget's form data and/or into the process's workflow variable. Download the demo app to try it out on your Joget DX platform.
Figure 1: Configure JSON API for Mapping Tools to Plugins
|JSON URL||URL to be called.|
Select the call type:
GET requests include all required data in the URL. GET is less secure compared to POST because the data sent is part of the URL. So it's saved in browser history and server logs in plaintext.
In contrast, HTTP POST requests supply additional data from the client (browser) to the server in the message body. POST is a little safer than GET because the parameters are not stored in browser history or in web server logs. From here.
(Only Applicable to Call type = POST)
Select the POST method:
|Request Headers||Add name(s) and value(s) to the request header.|
|No Response Expected|
Check if no response is expected so that even if there is a response, this tool will simply ignore it.
Using this option will also disable "store to form" and "store to workflow variable" properties.
|Debug Mode||Show relevant debug entries in the server log for debugging purposes.|
Figure 2: Store to Form
|Form||Select the target form to store data.|
|Base JSON Object Name for Multirow Data||Name of the object that contains an array to be based on.|
Mapping with JSON data with Form fields.
Figure 3: Store to Workflow Variable
|Workflow Variable Mapping|
Introduced in v5, the API Domain Whitelist setting in General Settings needs to be configured to allow JSON API requests. If a request is from a non-whitelisted domain, the response will be a HTTP 400 Bad Request. Enter asterisk " * " into the API Domain Whitelist field in General Settings to allow API calls.
In figure 2 and 3 above, you can specify how to treat the returned data. The returned data may be saved as form data or/add to be saved into process's workflow variable. The example used in this article shows how one can store multi-row data into a form data table.
Sample JSON API POST call: http://localhost:8080/jw/web/json/apps/published/userviews
Figure 4: Download the demo app below to view how JSON API is used in run process to populate form records