Hello,
I am using CRM Online and am having trouble making a request to an external api. Here is my code
function sendRequest() {
var xmlHttp = new XMLHttpRequest();
var url = "myapi.com/api";
var data = {"title":"Testing Here",""themeId":"123456789876532"};
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
callback(xmlHttp.responseText);
}
xmlhttp.setRequestHeader("access_token", "myaccesstoken");
xmlHttp.open("POST", url, true); // true for asynchronous
xmlHttp.send(JSON.stringify(data));
}