code: function postMessage(accessToken, registrationID, payload){
  
      if(accessToken == undefined || registrationID == undefined || payload == undefined){
          return;
      }
  
      console.log("\nSending message...");
  
      var post_data = JSON.stringify(payload);
  
      var api_path = "/messaging/registrations/" + registrationID + "/messages";
  
      var post_options = {
        host: "api.amazon.com",
        port: "443",
        path: api_path,
        method: "POST",
        headers: {
              "Authorization": "Bearer " + accessToken,
              "X-Amzn-Type-Version": "com.amazon.device.messaging.ADMMessage@1.0",
              "X-Amzn-Accept-Type" : "com.amazon.device.messaging.ADMSendResult@1.0",
              "Content-Type": "application/json",
              "Accept": "application/json",
        }
      };
  
      var req = https.request(post_options, function(res) {
  
          var data = "";
  
          res.on("data", function (chunk) {
              data += chunk;
          });
  
          res.on("end", function() {
              console.log("\nSend message response: ", data);
          });
  
      });
  
      req.on("error", function(e) {
        console.log("\nProblem with send message request: ", e.message);
      });
  
      req.write(post_data);
      req.end();
  
  }
docs: Post message payload to ADM server For more info, see: https://developer.amazon.com/public/apis/engage/device-messaging/tech-docs/06-sending-a-message