Skip to main content
added 139 characters in body
Source Link

when I put the response to Map, the Id disappeared enter image description here

when I put the response to Map, the Id disappeared enter image description here

Source Link

Cant get the 1st row from JSON Parsing array

Im trying to get the participants data from API response..

                //Level 1
                Map<String, Object> MapLv1 = (Map<String, Object>) JSON.deserializeUntyped(parser);
                system.debug('MapLv1 Conversation Summary ==>'+MapLv1);
                
                List<Object> arrayConversationSummary = new list <Object>();
                for (Object o : (List<Object>)Maplv1.get('participants')){
                    arrayConversationSummary.add(o);
                }

As you can see, i tried to get the participants array data and store it inside list of object..

this is the response example :

{
"id": "3a8c8cce-1630-4b97-addf-ebffd22360ed",
"startTime": "2018-11-05T10:39:29.517Z",
"endTime": "2018-11-05T10:45:58.398Z",
"address": "tel:+0000",
"participants": [
    {
        "id": "3fe49839-1297-464c-bab5-2b914f9e0257",
        "startTime": "2018-11-05T10:39:29.517Z",
        "endTime": "2018-11-05T10:44:57.877Z",
        "connectedTime": "2018-11-05T10:39:29.546Z",
        "name": "Mobile",
        "queueId": "f7866f57-3522-487e-9a62-7889cd68f782",
        "queueName": "Test Queue",
        "purpose": "customer",
        "participantType": "External",
        "address": "tel:0000",
        "ani": "tel:0000",
        "aniName": "Mobile",
        "dnis": "tel:+0000",
        "wrapupRequired": false,
        "attributes": {
            "SF_WorkSpace": "https://cs5.salesforce.com/console#https%3A%2F%2Fcs5.salesforce.com%2F003O000001COyPi%3Fkey%3D081932903944|%2Fapex%2FPolicyInfoPage%3FparentId%3D1159%26contactID%3D003O000001COyPi%26sessionID%3D003O000001COyPi-005900000052HdyAAE-20181105-05e5d7f02c24c2ee31622061bca94bd4%26policyNo%3D112-01-01%26entity%3DAFI%26policyApp%30000D%26agentS00ervicingCode%3D%26agentProducingCode%3D|%2Fapex%2FClaimInfoPage%3FparentId%3D1159%26contactID%3D003O000001COyPi%26sessionID%3D003O000001COyPi-005900000052HdyAAE-20181105-05e5d7f02c24c2ee31622061bca94bd4%26policyNo%3D112-01-01%26entity%3DAFI%26policyApp000%3D%26agentServicingCode%3D%26agentProducingCode%3D|%2Fapex%2FRHSInfoPage%3FparentId%3D1159%26contactID%3D003O000001COyPi%26sessionID%3D003O000001COyPi-005900000052HdyAAE-20181105-05e5d7f02c24c2ee31622061bca94bd4%26policyNo%3D112-01-01%26entity%3DAFI%26policyApp%3D%26agentServicingCode%3D%26agentProducingCode%3D|%2Fapex%2FCHSInfoPage%3FparentId%3D1159%26contactID%3D003O000001COyPi%26sessionID%3D003O000001COyPi-005900000052HdyAAE-20181105-05e5d7f02c24c2ee31622061bca94bd4%26policyNo%3D112-01-01%26entity%3DAFI%26policyApp%3D%26agentServicingCode%3D%26agentProducingCode%3D|%2Fapex%2FInquiryInfoPage%3FparentId%3D1159%26contactID%3D003O000001COyPi%26sessionID%3D003O000001COyPi-005900000052HdyAAE-20181105-05e5d7f02c24c2ee31622061bca94bd4%26policyNo%3D112-01-01%26entity%3DAFI%26policyApp%3D%26agentServicingCode%3D%26agentProducingCode%3D",
            "SF_WorkSpaceAssociations": "{\"interactionId\":\"0000-1630-0000-addf-0000000\",\"Contacts\":{\"00000\":{\"text\":\"PureCloud 0000- Contact\",\"id\":\"00000\",\"reason\":\"Workspace Transfer\",\"select\":true}},\"Relates\":{}}",
            "CWC_allowACD": "true"
        },
        "calls": [
            {
                "state": "terminated",
                "id": "c339db69-12ac-4cad-9f71-6490c1778b46",
                "direction": "inbound",
                "recording": false,
                "recordingState": "none",
                "muted": false,
                "confined": false,
                "held": false,
                "segments": [
                    {
                        "startTime": "2018-11-05T10:39:29.520Z",
                        "endTime": "2018-11-05T10:39:29.546Z",
                        "type": "System",
                        "howEnded": "Interact"
                    },
                    {
                        "startTime": "2018-11-05T10:39:29.546Z",
                        "endTime": "2018-11-05T10:44:57.877Z",
                        "type": "Interact",
                        "howEnded": "Disconnect",
                        "disconnectType": "endpoint"
                    }
                ],
                "disconnectType": "endpoint",
                "connectedTime": "2018-11-05T10:39:29.546Z",
                "disconnectedTime": "2018-11-05T10:44:57.877Z",
                "disconnectReasons": [],
                "provider": "Edge",
                "self": {
                    "name": "Mobile",
                    "nameRaw": "",
                    "addressNormalized": "tel:000000",
                    "addressRaw": "sip:[email protected]",
                    "addressDisplayable": "unavailable"
                },
                "other": {
                    "name": "Jakarta, Indonesia",
                    "nameRaw": "",
                    "addressNormalized": "tel:+00000",
                    "addressRaw": "sip:00000@000-000:5060",
                    "addressDisplayable": "unavailable"
                }
            }
        ]

but when I check the debug, the participants data start from 'address' not from 'id', and the parsing result only get the address, ani, and aniName from the JSON response.. there`s no Id..

enter image description here