var apiUrl = ‘https://api.mxtoolbox.com/api/v1/Lookup/ns/’;
var apiKey = ‘e5df9a25-735d-46e0-bb24-409dfa0843f9’;
$.ajax({
url: apiUrl,
type: ‘GET’,
dataType: ‘json’,
success: function (result) {
//OnSuccess Callback
},
error: function (xhr, status, error) {
//OnError Callback
},
beforeSend: function (xhr) {
if (apiKey) {
xhr.setRequestHeader(‘Authorization’, apiKey);
}
}
});