Javascript

Javascript - Jquery Method

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://pickyassist.com/app/api/v2/push",
  "method": "POST",
  "headers": {
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{\"token\":\"c2a0b6221c5dd55ceb09ae1f74e46521756d\",\"priority \":0,\"application\":\"2\",\"sleep\":0,\"globalmessage\":\"\",\"globalmedia\":\"\",\"data\":[{\"number\":\"1212\",\"message\":\"Test\"}]}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

Javascript - XMLHttpRequest

var data = JSON.stringify({
  "token": "c2a0b6221c5dd55ceb09ae1f74e46521756d",
  "priority ": 0,
  "application": "2",
  "sleep": 0,
  "globalmessage": "",
  "globalmedia": "",
  "data": [
    {
      "number": "1212",
      "message": "Test"
    }
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://pickyassist.com/app/api/v2/push");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

Last updated