How can I access only the first @NOTIFICATION_OPENED
key?
How can I sum both values of @NOTIFICATION_OPENED
?
This is my AJAX request:
$.getJSON("myapiurl", function(notificationData) {
$.each(notificationData.data, function(index, value) {
if (value["@NOTIFICATION_OPENED"]) {
var notificationOpened = value["@NOTIFICATION_OPENED"]
} else
notificationOpened = 0;
var val = {
"notificationOpened": notificationOpened
}
_data.push(val)
});
}
This is the data I retrieve from the API using the above request:
{
"data": [{
"date": 1577836800000,
"@NOTIFICATION_SENT": 62629,
"@NOTIFICATION_OPENED": 404
}, {
"date": 1577923200000,
"@NOTIFICATION_OPENED": 734
}]