Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

JQUERY/CORS Web API Authentication Error

$
0
0

I am trying to use CORS with JQUERY in order to retrieve data through a web API , however, I keep getting an authentication error and from the research I have done, apparently I need to set the server http response header first. How do I do this JQUERY/MVC please?

$(document).ready(function () {

var request = $.ajax({
type: 'GET',
url: "https://api-eu.myconnectwise.net/v2017_1/apis/3.0/service/tickets/13024/",
headers: { 'Authorization': 'Basic ' + btoa('#######' + '+' + '################" + ':' + "###############") },
dataType: "jsonp",
xhrFields: {
withCredentials: true
}
});
request.done(function (data) {
console.log(data);
});
});


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>