I have this JSON data From where i have to fetch the "id"`
{
"_embedded": {
"users": [{
"id": "5d54e31886d2db014eefbf45",
"email": "[email protected]",
"name": "Custom Developer",
"active": true,
"gender": "NotSpecified",
"extension": null,
"external_phone_number": null,
"created_at": "2019-08-15T04:44:08Z",
"_links": {
"self": {
"href": "https://api.talkdeskapp.com/users/5d54e31886d2db014eefbf45"
}
}
}]
},
"count": 1,
"total": 1,
}
I have tried this code but stucked in parsing between Maps.
HttpResponse httpRes = httpToken.send(httpReq);
Map<String, Object> jsonResponse = new Map<String, Object>();
String resultgetuserid = String.valueOf(httpres.getBody());
System.debug('Response' + resultgetuserid);
jsonResponse = (Map<String, Object>)JSON.deserializeUntyped(httpres.getBody());
System.debug('Response : ' + jsonResponse);
Map<String, Object> myMaps = new Map<String, Object>();
List<Object> myMapObjects = (List<Object>) jsonResponse.get('_embedded');
//System.debug('myMaps' + myMaps);
String userId = ''; // to be retrieved
System.debug('User ID: ' + userId);
return userId;
Thanks in Advance.