How to perform a REST API call directly from a Bonita form

romain.bioteau's picture
romain.bioteau
Blog Categories: 

Example built with Bonita 7.9.1. Use public web service at jsonplaceholder.typicode.com

This example, available on Bonitasoft Community GitHub, demonstrates how to perform a REST API call directly from a Bonita form. It is useful when you need to display data that you can get by calling a REST API.

The solution is to build using:

  • a form variable of type "External API"
  • the form variable initial value set by specifying the the URL of the REST API to call in the variable configuration (GET request)
  • the form variable is then bound to form widgets (a table in this example) to display the value

Note that in this example all the processing happens on the client side, i.e. in the web browser of the user who displays the form.

If you need to process the result of the REST API call as part of your process execution (for example use it in a gateway condition or as input for a connector) you should use the REST connector instead. Another example is available to demonstrate this alternative.

Notifications