Trying to display data from api api secret key:$2b$10$NQY9ge9Lc7fr9E98t6wcGuBiQ1ckBgbxN0fpbL2qIF9/zzOH30NXm
The api key link: https://api.jsonbin.io/b/5f54c4ac4d8ce4111389dc46/1
The jquery Code:
$.ajax(
{
url: 'https://api.jsonbin.io/b/5f54c4ac4d8ce4111389dc46/1',
type:'GET',
dataType: 'json',
data:{
"key":btoa("pd_adeptcom_bnd:xk8MU9TR")
},
beforeSend: function(xhr) {
$("#imagelodaing").show();
xhr.setRequestHeader("Authorization", "Basic " + btoa("c65eRs3znBAQIILs0cUvkrbRRl87LvBW"));
},
success: function(json)
{
$("#imagelodaing").hide();
// get the `airport` array
var device = json.siteList;
var j = 1;
// loop through the array to populate your list
$.each(device, function(i, sites)
{
// console.log(sites.siteName)
// $('#data_table').append("<tr>" + "<td>" + sites.siteName + "</td>" + "</tr>");
$.each(sites.deviceList, function(i, values)
{
var time = (values.count * 25) / 60;
// append values to table
$('#data_table').append("<tr>" + "<td><input type='checkbox' class='checkbox' name='check' id='checked_box" + j + "' value='" + j + " 'onclick='get_checks(this)' ></td>" + "<td>" + sites.siteName + "</td>" + "<td>" + values.deviceName + "</td>" + "<td>" + values.count + "</td>" + "<td>" + parseFloat(time).toFixed(2) + " Min" + "</td>" + "<input type='hidden' class='time' id='count' name='count[]' value=" + time + ">" + "</tr>");
if (values.status == "READY")
{
$('#checked_box' + j + '').attr('disabled', true);
$('#checked_box' + j + '').closest("tr").addClass('table-active');
}
else if (values.status == "IN PROGRESS")
{
$('#checked_box' + j + '').attr('disabled', true);
$('#checked_box' + j + '').closest("tr").addClass('table-active');
}
j++;
});
});
},
error:function(){
console.log('failed');
$("#imagelodaing").hide();
}
});
But it is showing me this error:
message: "Need to provide a secret-key to READ private bins", success: false} message: "Need to provide a secret-key to READ private bins" success: false
Help Me Out Fixing it please,Anyhelp would be Highly appreciated
