API MOTU ultralite mk4
Posted: Mon Dec 12, 2016 1:56 pm
Hello,
I am an amateur and I recently bought a MOTU UltraLite mk4.
I try to change values via API provided by MOTU but I can not do it ...
Here is my code:
I have always error 400 bed request ...
Can you help me ?
Thanks you
I am an amateur and I recently bought a MOTU UltraLite mk4.
I try to change values via API provided by MOTU but I can not do it ...
Here is my code:
Code: Select all
var getJSON = function(url, successHandler, errorHandler) {
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
//xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
successHandler && successHandler(xhr.response);
} else {
errorHandler && errorHandler(status);
}
};
xhr.send(JSON.stringify('json={"value":"test"}));
};
getJSON('http://localhost:1280/0001f2fffe002213/datastore/ext/obank/2/ch/0/name', function(data) {
alert('Your public IP address is: ');
}
, function(status) {
alert('Something went wrong.');
});
Can you help me ?
Thanks you