Form   ->   Restful API

Form call restful API


Form can be connected with the third-party data by calling the user-defined URL through configuration. Third-party data needs to have:

Setup


By clicking the [Configure] icon in the form, users can start the configuration:

Tip: users can customize the button title

Click the "Detail" button to set up the parameters:


Parameter description


Users need provide a URL, and it will return a JSON data when running this URL. For example:

https://www.cubedrive.com/lite/formRestAPITest/json?apiKey=1234567
{"success":true,"response_code":0,"verbose_msg":"","content":[{"data":"94.237.43.47","now":[{"severity":"high","type":"hacker"},{"severity":"low","type":"scan"}],"machinename":"10.176.20.9","location":{"country":"Germany","province":"AABB","city":"CCDD"},"asn":"UPCLOUD, FI"}]}
Tip: Only the form authors can see the URL address. The end user's browser does not have this URL information, and cannot see this information.

Users need to pass some parameters in the URL. These parameters can be entered by the end user in a form. For example: IP address.

Tip: Parameter names are user-defined and can match the form's field. After matching, the system will send it to the third party in the form of GET to obtain the information.

The information returned by the third-party query must be in JSON format, and users can also match the form field. The result variable must start with $result

Tip: If the result is an array; the result will be separated by commas.

Result


After configuration, users can open the form and click the query button. The system automatically fills the returned results into the form fields.

Tip: If the parameters are configured and the user does not input the parameters when filling out the form, the system will automatically report an error.