const YO_API_TOKEN = "YO_API_TOKEN_GOES_HERE"; device.on("yo", function(nothing) { local url = "http://api.justyo.co/yoall/"; local body = "api_token=" + YO_API_TOKEN; local req = http.post(url, {}, body); local res = req.sendsync(); if(res.statuscode != 201) { server.log(res.statuscode + " error sending message: " + res.body); } else server.log("Sent YO! to all CITRIXKITCHEN subscribers " + res.statuscode + " OK"); }); server.log("Turn the LED off by browsing to " + http.agenturl()); http.onrequest(function(request, res) { server.log("We received an http request"); device.send("request", null); res.send(200, "Okay! Turning LED off now..."); }); device.onconnect(function() {server.log("Device connected to agent");}); device.ondisconnect(function() {server.log("Device disconnected from agent");});