alarms-as-a-service
A web service built on top of reschedule.js, rrecur.js, and rrule.js for being notified when a one-time or repeat event is taking place.
POST /api/alarms
Request
"dtstart": "utc": "2014-06-16T12:40:00Z" "zoneless": "2014-06-16T08:40:00" "locale": "GMT-0400 (EDT)" "tzid": "America/New_York" "webooks": "occurrence": "http://bin.mailgun.net/a90b3f8c" "stop": "http://requestb.in/1hp8ppg1" "data": "foo": "bar" "desc": "Whatever you supply to the 'data' field is what your webhook gets back" rrule: freq: 'yearly'
NOTE:
tzid
is not currently supported. You must uselocale
and eitherutc
orzoneless
.- You may supply
data
if you wish. It may contain whatever you like, but must be very few bytes.
Response
"uuid": "aedda258-0392-4b36-9e0c-274db9f7e9de" "next": "2014-07-16T08:40:00-0400"
POST /your/webhook/occurence
"uuid": "aedda258-0392-4b36-9e0c-274db9f7e9de" "next": "2014-06-16T08:40:00-0400" "data": ...
NOTE: next
may be null
Response
{}
Or, if you want to postpone the alarm:
"snooze": 900 // 15 minutes in seconds
POST /your/webhook/stop
Request
"uuid": "aedda258-0392-4b36-9e0c-274db9f7e9de" "data": ...
Response
{}
Example Usage
var url rules ; url = 'http://alarms.beta.coolaj86.com/api/schedules'; rules = dtstart: utc: Date + 15 * 1000 locale: 'GMT-0600 (MDT)' tzid: 'America/Denver' rrule: null webooks: occurrence: "http://requestb.in/16rh3i11" stop: "http://requestb.in/1hp8ppg1" data: foo: "bar" request;
DIY
Install
npm install alarms-as-a-service
'use strict'; var port = 3000 app server ; app = ; server = app;
API
moduleexports // returns an appmoduleexportsalarmsadd // function (req, res) {}moduleexportsalarmsremove // function (req, res) {}