Hi,
I'm currently trying to use the API to control remotely my Ultimaker 3 with a webpage.
So, I use Ajax to make a request on the printer but it won't allow me to make the request.
For the moment I try to check the validity of the id :
function checkTicket(ticketId) {
$.ajax({
type: 'GET',
url: 'http://192.168.1.120/api/v1/auth/check/' + ticketId,
contentType: 'application/json',
headers: {
'Accept': 'application/json'
}
}
).done(function (data, textStatus, jqXHR) {
console.log(data);
switch (data.message) {
case "authorized":
break;
default:
requestTicket(user.name);
break;
}
}).fail(function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
});
But I got an error :
My request headers :
Accept:*/*
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.9
Access-Control-Request-Headers:content-type
Access-Control-Request-Method:GET
Cache-Control:no-cache
Connection:keep-alive
DNT:1
Host:192.168.1.120
Origin:http://127.0.0.1
Pragma:no-cache
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36
Thanks for your help !