Schedules are used for setting time windows for notifications. In the web site they are under Account Settings -> Notification Windows.
Get a schedule or list of schedules
Request example: ("Days" is the id passed)
curl -X GET 'https://api.nodeping.com/api/1/schedules/Days'
Response example:
{ "monday": { "time1": "6:00", "time2": "18:00", "exclude": 0 }, "tuesday": { "time1": "6:00", "time2": "18:00", "exclude": 0 }, "wednesday": { "time1": "6:00", "time2": "18:00", "exclude": 0 }, "thursday": { "time1": "6:00", "time2": "18:00", "exclude": 0 }, "friday": { "time1": "6:00", "time2": "18:00", "exclude": 0 }, "saturday": { "time1": "6:00", "time2": "18:00", "exclude": 0 }, "sunday": { "time1": "6:00", "time2": "18:00", "exclude": 0 } }
Create or update a schedule. Since you get to set the ID for these, create and updates use identical calls and only PUT is needed.
Request example: ("Foo" is the id passed in the URL)
curl -X PUT -d'json={"data":{"monday":{"time1":"6:00","time2":"18:00","exclude":0},"tuesday":{"time1"6:00","time2":"18:00","exclude":0},"wednesday":{"time1":"6:00","time2":"18:00","exclude":0},"thursday":{"time1":"6:00","time2":"18:00","exclude":0},"friday":{"time1":"6:00","time2":"18:00","exclude":0},"saturday":{"time1":"6:00","time2":"18:00","exclude":0},"sunday":{"time1":"6:00","time2":"18:00","exclude":0}}}' 'https://api.nodeping.com/api/1/schedules/Foo'
Response example:
{"ok":true,"id":"201205050153W2Q4C"}
Delete a schedule
Request example: ("Foo" is the id passed in the URL)
curl -X DELETE 'https://api.nodeping.com/api/1/schedules/Foo'
Response example:
{"ok":true,"id":"201205050153W2Q4C"}