JSON (JavaScript Object Notation) is a lightweight data-interchange format that follows a defined structure. A JSON response can contain an array which is denoted by square ([]) brackets, an object which is denoted by curly ({}) braces or a combination thereof. An array is a collection of objects. Every JSON response has key-value pairs which are denoted by a colon (:). Multiple key-value pairs can exist within an object and are separated by a comma (,).

JSON responses, while following a defined structure, can vary in terms of which elements are included (arrays, objects) and as such OneCloud provides the JSON Output Schema field on the HTTP BizApp Commands (GET, POST, DELETE, PUT) to allow the format of the schema to be specified and subsequently navigated.

The Output Schema field is optional, but, it greatly simplifies the usage of the JSON keys in subsequent OneCloud Commands by allowing the JSON response to be navigated from the Variable selection pane.

In this example of a subsequent Command, selecting the Account key from the item array returns the following:

Clicking on the Response Variable displays the automatic JSON parsing that OneCloud performed to extract the Account key from the item array:

Populating the Output Schema is very simple. Once an HTTP BizApp Command has been saved, Publish and Execute the Chain. Review the Chain execution and the Log panel for the HTTP Command. The JSON response from the Command will be displayed. Simply highlight and copy this line from the Log panel and paste it into the Output Schema field of the HTTP BizApp Command. Now, the JSON response can navigated as shown above.

If you have any questions or comments, please feel free to contact us at support@onecloud.io.

Did this answer your question?