Search

Use List and Map for repeated responses.

Declare the Response variable, and the repeated Json object array utilizes loop statements, List, and Map blocks.

Declare the response to be received by calling the API as a single variable called response.
If there is an array of Json objects that are repeated in this response value, first declare List and Map variables before executing the loop.
And, add the Map key and value to be included in the List variable through the Foreach statement using the Add List(Map) Variable block.
Finally, if you assign this list to the response variable, you can conveniently check the response value in the Json object array format.
Below is the example of working with similar logic to the previous example without variable declarations and loops.
The result may be similar, but there is a significant difference from the previous example in code readability and block rendering.
The key to building an API is its architectural design.
In the process of calling the API and receiving response data, the logic should be configured to reduce the load on the system and reuse the code.