0
I want to get the strings from inside the field text
but they end up returning null
.
The JSON I get is this:
{"type":"RichMessage","message":{"type":"ChatWindowMenu","name":"Blitz","items":[{"text":"Login"},{"text":"Registro"}],"schedule":{"responseDelayMilliseconds":0.0},"agentId":"0Xx5Y000000g5uPSAQ"}}
Code:
JsonReader reader = Json.createReader(con.getInputStream());
JsonObject mresObj = reader.readObject();
JsonArray items = mresObj.getJsonArray("text");
for (int i = 0; i < items.size(); i++) {
JsonObject arrayItems = items.getJsonObject(i);
System.out.println("items->"+arrayItems.toString());
}