Can't call API in c9 workspace

javascript

#1

Hi, I have created an API in c9.io and am now trying to call it from a javascript file. I am able to get it to work using postman but I am unable to make an AJAX request to it. I have already made my Application URL public so that wasn’t the issue. Here is my code that calls it:
$.ajax({
url: ‘https://se3316a-lab3-sammallabone.c9users.io/api/message’,
error: function(jqXHR, textStatus, errorThrown) {
alert(‘error’ + jqXHR + " " + textStatus + " " + errorThrown);
},
dataType: ‘json’,
success: function(data) {
alert(‘success’);
},
type: ‘GET’
});

I have made datatype json and jsonp with neither working. Every time I call the API, the error function is called and the success function is never called.

Any help on how to solve my problem is appreciated.