I'm working with an API that returns results of a search in the form of multiple nested objects. The root object contains a list of objects where the keys of those objects are ID numbers.
The API returns JSON in the format below
{
"response": {
"214938": {
"orderId": 163244,
"warehouseId": 2,
"transfer": false,
"priority": false,
"status": {
"shipped": true,
"packed": true,
"picked": true,
"printed": true
}
},
"223579": {
"orderId": 169875,
"warehouseId": 1,
"transfer": false,
"priority": false,
"status": {
"shipped": true,
"packed": true,
"picked": true,
"printed": true
}
}
}
}
I wish to capture the ID's which are the keys of the objects listed within the 'response' object. These ID's are not available anywhere else in the API so I need to find a way to achieve this with the given JSON. All of my research has not yielded anything that points me in the right direction.
Is this achievable? Am I missing something obvious?
Thanks!