Q:

Parsing JSON array to complete a few tasks

Is it possible to parse the following JSON array using jQuery to do a few things: 
{
    "status": "success",
    "matches": 2,
    "results": [{
        "call_mine_status": "not mined",
        "cdr_source": "CE",
        "tracking_number": "5555555555",
        "disposition": "ANSWERED",
        "duration": 284,
        "external_id": null,
        "id": 25039100,
        "is_outbound": 0,
        "ouid": 49677,
        "repeat_call": false,
        "caller_id": "7777777777",
        "calldate": "2015-12-01 13:50:03",
        "ringto_number": "9999999999",
        "title": null,
        "user_id": null,
        "scored": false,
        "call_value": null,
        "indicator": {
            "active_indicators": [

            ],
            "custom_indicators": [

            ]
        },
        "tagged": false,
        "mine_error": "",
        "call_recorded": "92cda5a0-3929-4773-9d4b-1a8deb14570c",
        "file_url": "http://s3.amazonaws.com/info1.mp3",
        "postcall_response": [{
            "postcall_ivr_type": null,
            "postcall_ivr_response": null
        }],
        "postcall_option": [{
            "option_order": 1,
            "details": [{
                "postcall_ivr_enabled": "false",
                "postcall_ivr_tts": null,
                "postcall_ivr_type": null,
                "postcall_ivr_digits": null
            }]
        }]
    }, {
        "call_mine_status": "not mined",
        "cdr_source": "CE",
        "tracking_number": "6666666666",
        "disposition": "ANSWERED",
        "duration": 213,
        "external_id": null,
        "id": 25041531,
        "is_outbound": 0,
        "ouid": 49677,
        "repeat_call": false,
        "caller_id": "8888888888",
        "calldate": "2015-12-01 14:20:21",
        "ringto_number": "9999999999",
        "title": null,
        "user_id": null,
        "scored": false,
        "call_value": null,
        "indicator": {
            "active_indicators": [

            ],
            "custom_indicators": [

            ]
        },
        "tagged": false,
        "mine_error": "",
        "call_recorded": "fe38b368-315a-4de6-86b2-8674c705e128",
        "file_url": "http://s3.amazonaws.com/info2.mp3",
        "postcall_response": [{
            "postcall_ivr_type": null,
            "postcall_ivr_response": null
        }],
        "postcall_option": [{
            "option_order": 1,
            "details": [{
                "postcall_ivr_enabled": "false",
                "postcall_ivr_tts": null,
                "postcall_ivr_type": null,
                "postcall_ivr_digits": null
            }]
        }]
    }],
    "transaction_id": 355071629
}

Total Count of Disposition with a value of Answer
Total sum of Duration value
On each object if Disposition value == Answer and Duration > 90 do console.log of 1 

Any help would be appreciated

A:

I won't do all your homework, but I'll get you started (hopefully providing you with the tools you need to solve the rest on your own):
First I would create a variable containing the JSON object.
Let's call this variable myJSON. What we are looking at is a list of key value pairs. These can be "navigated" just like any other object:
console.log(myJSON.status);
// returns "success"
console.log(myJSON.results);
// returns an array

Now you could for example iterate through myJSON.results like you would with any other array:

var myJSON = {"status":"success","matches":2,"results":[{"call_mine_status":"not mined","cdr_source":"CE","tracking_number":"5555555555","disposition":"ANSWERED","duration":284,"external_id":null,"id":25039100,"is_outbound":0,"ouid":49677,"repeat_call":false,"caller_id":"7777777777","calldate":"2015-12-01 13:50:03","ringto_number":"9999999999","title":null,"user_id":null,"scored":false,"call_value":null,"indicator":{"active_indicators":[],"custom_indicators":[]},"tagged":false,"mine_error":"","call_recorded":"92cda5a0-3929-4773-9d4b-1a8deb14570c","file_url":"http://s3.amazonaws.com/info1.mp3","postcall_response":[{"postcall_ivr_type":null,"postcall_ivr_response":null}],"postcall_option":[{"option_order":1,"details":[{"postcall_ivr_enabled":"false","postcall_ivr_tts":null,"postcall_ivr_type":null,"postcall_ivr_digits":null}]}]},{"call_mine_status":"not mined","cdr_source":"CE","tracking_number":"6666666666","disposition":"ANSWERED","duration":213,"external_id":null,"id":25041531,"is_outbound":0,"ouid":49677,"repeat_call":false,"caller_id":"8888888888","calldate":"2015-12-01 14:20:21","ringto_number":"9999999999","title":null,"user_id":null,"scored":false,"call_value":null,"indicator":{"active_indicators":[],"custom_indicators":[]},"tagged":false,"mine_error":"","call_recorded":"fe38b368-315a-4de6-86b2-8674c705e128","file_url":"http://s3.amazonaws.com/info2.mp3","postcall_response":[{"postcall_ivr_type":null,"postcall_ivr_response":null}],"postcall_option":[{"option_order":1,"details":[{"postcall_ivr_enabled":"false","postcall_ivr_tts":null,"postcall_ivr_type":null,"postcall_ivr_digits":null}]}]}],"transaction_id":355071629}


$('button').on('click', function () {
  var count = 0;
  $.each(myJSON.results, function ( key, value ) {
    if (value.disposition === "ANSWERED") {
      count++;
    }
  });
  $('span').html(count);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button type="button">Check for answers</button>
<h2><span></span> answers found</h2>

