JSFiddle - React, Tailwind, and code Playground

by Sivasakthi Chandrasekaran

HTML

<button type="button" name="Schedul Job" onclick="loadDoc()" >
Schedule 
</button>

JavaScript

function loadDoc() {
var http = new XMLHttpRequest();
var url = "https://alapp.relevantmobile.com/api/v1/push_services/submit_skip_auth?";
var params = "[email protected]&chain_id=17&service_type=1&select_type=manual_enter&point=1&year=2017&month=8&day=30&hour=23&minute=35&time_zone_default=EDT&user_ids=324932,370886";
http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Authorization", "Basic YWRtaW46cmVsMTIzNDU=");
http.onreadystatechange = function() {//Call a function when the state changes.
    if(http.readyState == 4 && http.status == 200) {
    var obj = jQuery.parseJSON( http.responseText );
		alert( obj.notice );
    }
}
http.send(params);
  }