I am using the online json tool to parse this json, but it seems the json is having repeated keys hence the json tool is unable to give me the correct code. Does anyone know how to get this informations from this json.
Here are the informations I want to get from the json,
XXXX_USERID_HERE
XXXX_BASE64_IMAGE_HERE
XXXX_STATUS_HERE
XXXX_LASTNAME_HERE
XXXX_OTHERNAMES_HERE
XXXX_DOB_HERE
XXXX_POLLINGSTATION_HERE
XXXX_CONSTITUENCY_HERE
XXXX_DISTRICT_HERE
XXXX_REGION_HERE
XXXX_REGISTRATIONDATE_HERE
Here are the informations I want to get from the json,
XXXX_USERID_HERE
XXXX_BASE64_IMAGE_HERE
XXXX_STATUS_HERE
XXXX_LASTNAME_HERE
XXXX_OTHERNAMES_HERE
XXXX_DOB_HERE
XXXX_POLLINGSTATION_HERE
XXXX_CONSTITUENCY_HERE
XXXX_DISTRICT_HERE
XXXX_REGION_HERE
XXXX_REGISTRATIONDATE_HERE
Code from json tool:
Dim parser As JSONParser
parser.Initialize(<text>)
Dim jRoot As Map = parser.NextObject
Dim input As Map = jRoot.Get("input")
Dim id As String = input.Get("id")
Dim type As String = input.Get("type")
Dim items As List = input.Get("items")
For Each colitems As Map In items
Dim id As String = colitems.Get("id")
Dim content As String = colitems.Get("content")
Dim outgoingEdgeId As String = colitems.Get("outgoingEdgeId")
Next
Dim messages As List = jRoot.Get("messages")
For Each colmessages As Map In messages
Dim id As String = colmessages.Get("id")
Dim type As String = colmessages.Get("type")
Dim content As Map = colmessages.Get("content")
Dim type As String = content.Get("type")
Dim richText As List = content.Get("richText")
For Each colrichText As Map In richText
Dim children As List = colrichText.Get("children")
For Each colchildren As Map In children
Dim text As String = colchildren.Get("text")
Next
Dim type As String = colrichText.Get("type")
Next
Next
Dim logs As List = jRoot.Get("logs")
JSON String:
{
"messages": [{
"id": "lib14rs0pew3468a3gyvdeha",
"type": "text",
"content": {
"type": "richText",
"richText": [{
"type": "p",
"children": [{
"text": "Searching for "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_USERID_HERE"
}
]
}
]
}, {
"text": ". Please wait..."
}
]
}
]
}
}, {
"id": "hxcwy72ycv7capmk5glm6b9y",
"type": "image",
"content": {
"url": "data:image/png;base64,XXXX_BASE64_IMAGE_HERE"
}
}, {
"id": "qqurgm4zoa7o6n3lxpdrfbv6",
"type": "text",
"content": {
"type": "richText",
"richText": [{
"type": "p",
"children": [{
"text": "Status: "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_STATUS_HERE"
}
]
}
]
}
]
}
]
}
}, {
"id": "bajvdw2ueqzontkgz4oomnzc",
"type": "text",
"content": {
"type": "richText",
"richText": [{
"type": "p",
"children": [{
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_LASTNAME_HERE"
}
]
}
]
}, {
"bold": true,
"text": " "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_OTHERNAMES_HERE"
}
]
}
]
}
]
}, {
"type": "p",
"children": [{
"text": "Date of Birth:"
}, {
"bold": true,
"text": " "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_DOB_HERE"
}
]
}
]
}
]
}, {
"type": "p",
"children": [{
"text": "Polling Station: "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_POLLINGSTATION_HERE"
}
]
}
]
}
]
}
]
}
}, {
"id": "qcjcm194qx8o19dw0koyuwox",
"type": "text",
"content": {
"type": "richText",
"richText": [{
"type": "p",
"children": [{
"text": "Constituency: "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_CONSTITUENCY_HERE"
}
]
}
]
}
]
}, {
"type": "p",
"children": [{
"text": "District: "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_DISTRICT_HERE"
}
]
}
]
}
]
}, {
"type": "p",
"children": [{
"text": "Region:"
}, {
"bold": true,
"text": " "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_REGION_HERE"
}
]
}
]
}
]
}, {
"type": "p",
"children": [{
"text": ""
}
]
}, {
"type": "p",
"children": [{
"text": "Date of Registration: "
}, {
"type": "inline-variable",
"children": [{
"type": "p",
"children": [{
"bold": true,
"text": "XXXX_REGISTRATIONDATE_HERE"
}
]
}
]
}
]
}
]
}
}
],
"input": {
"id": "agfeet8x30smlyr88tk16zi8",
"type": "choice input",
"items": [{
"id": "iysj65jb8kv93ygi5fty9kur",
"outgoingEdgeId": "bkl6eibkhvojqce4anxpsoiw",
"content": "Check Another"
}
]
},
"logs": []
}