...
- Visitor would request for demo by submitting a form in the Joget app.
- Upon submission of the form, fields will be validated to make sure that all mandatory fields are filled up.
Upon successful validation of data, the form data will be shared with external system (i.e. CRM software) for further processing through the use plugins (i.e. JSON Tool) or Bean Shell code such as the sample:-
Code Block language java title Bean Shell code to make restful API calls sample linenumbers true import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import java.io.IOException; import org.joget.commons.util.LogUtil; try{ String jsonUrl = "http://sample.joget.com/api"; String name = "header1"; String value = "value1"; CloseableHttpClient client = null; CloseableHttpClient client = HttpClients.createDefault(); HttpRequestBase request = null; request = new HttpGet(jsonUrl); request.setHeader(name, value); HttpResponse response = client.execute(request); } catch (Exception ex) { LogUtil.error(getClass().getName(), ex, ""); } finally { try { if (request != null) { request.releaseConnection(); } if (client != null) { client.close(); } } catch (IOException ex) { LogUtil.error(getClass().getName(), ex, ""); } }
- The main objective is to ensure successful delivery of data with the external system.
...