I'm trying to do a very basic GET request to the Codewars API, but for some reason I'm getting an error saying Unexpected token :
.
Here is my code:
var apiKey = 'iJUXzfpo96eUXXa-BzsT';
var baseURL = 'https://www.codewars.com/api/v1';
var user = 'GiacomoSorbi';
// Example GET user
$.ajax({
type: 'GET',
url: `${baseURL}/users/${user}?${apiKey}`,
dataType: 'JSONP',
success: function (data) {
console.log(data);
}
});
and here's a JSFiddle. Any help would be appreciated.
EDIT:
Here is a link to the response I get.