I've been playing with the api today (working well through postman) but when i try to access with javascript i'm getting "Response for preflight has invalid HTTP status code 405".
I understand that this is due to adding the additional request headers for the Authorization etc but i dont know how to resolve.. do you have any guides or tips on how to get around this?
var xhr = new XMLHttpRequest(),
method = "GET",
url = "https://webapi.teamviewer.com/api/v1/sessions";
xhr.open(method, url, true);
xhr.setRequestHeader('Authorization', '2793660-XXXXXXXXXXXXX');
xhr.onreadystatechange = function () {
if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
console.log(xhr.responseText);
}
};
xhr.send();