Register User Device - jQuery / AJAX

Source Code:

  

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://send.pushnotificationapi.com/v1/device/add",
  "method": "POST",
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
    "cache-control": "no-cache"
  },
  "data": {
    "api_key": "YOUR-API-KEY",
    "device_token": "YOUR-DEVICE-TOKEN",
    "platform": "YOUR-PLATFORM",
    "user_id": "OPTIONAL-USER-ID",
    "tag": "OPTIONAL-TAG"
  }
}

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