I am getting some data in response to my code which is a JSON string as:
HTTPResponse res = {"id":2048,"extension_attributes":{"stock_item":{"stock_id":1}}}
Now to retrieve data, I've done
Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(res.getBody());
Object attr = results.get('extension_attributes');
Here attr
is again containing 'stock_item' which finally contains 'stock_id'. Though I am unable to get this by any way from this object. I hope someone would have solution for this.