I have below JSON response from the request. I'm aware how to extract value from the response using JSON Extractor but here I have different json response without stating curly braces and it start from string OK. I tried wildcard operator but didn't get any result. I want to extract value 14869 from this response.
OK
[
[
[
14869,
8708,
5032,
463863,
"AssignmentCardLearning",
"{\"type\": \"AssignmentCardRefreshDone\", \"value\": {\"byEducator\": true}}",
"{\"openTime\": 1701326839556, \"finishTime\": 1701326994605, \"postponeData\": null, \"lastTimeOpened\": 1702469689831, \"lastTimeOpenedBy\": {\"type\": \"AssignmentCardOpenedByUser\", \"value\": {}}, \"availabilityDatesM\": null, \"previousFinishTime\": null}",
"{\"tags\": [{\"type\": \"AssignmentCardGracePeriodNotified\", \"value\": {\"closed\": false}}], \"loIds\": [], \"language\": null, \"practiceSetLOs\": [], \"packageTopicsIds\": [5032]}",
0,
"2023-11-30 06:47:14",
0,
0,
0
]
]
]
JSON can begin with
[
as well in case of JSON ArrayIn particular your case you can do it in 2 steps:
Remove this line containing
OK
by adding a JSR223 PostProcessor and using the following Groovy code in it:Once done you should be able to use JSON Extractor and the following JSONPath query:
Demo: