Currently, I am calling an API every 3 minutes to get weather data. This is the response I get as a String:
{
"data": {
"timelines": [
{
"timestep": "current",
"endTime": "2023-01-20T13:33:00-05:00",
"startTime": "2023-01-20T13:33:00-05:00",
"intervals": [
{
"startTime": "2023-01-20T13:33:00-05:00",
"values": {
"dewPoint": 18.63,
"humidity": 66,
"precipitationIntensity": 0,
"precipitationProbability": 0,
"pressureSeaLevel": 1019.19,
"pressureSurfaceLevel": 1018.65,
"temperature": 25.5,
"temperatureApparent": 25.5,
"uvIndex": 3,
"windDirection": 151.69,
"windSpeed": 4.88
}
}
]
}
]
}
}
I would like to know how to extract the value of the attributes in "values" (like "dewPoint", "humidity", etc.).
I've been trying to do this with Beans and such, but the fact that the data is nested and some of it is an array is making it difficult for me to understand. Basically, I want to extract each of the values of the attributes in "values" from a JSON String, concat them in to an array of only the values, and then send that array to be saved in a database.