Documentation

API Reference :: schedules

Schedules are used for setting time windows for notifications. In the web site they are under Account Settings -> Notification Windows.

GET

Get a schedule or list of schedules

  • customerid - optional string - customerid of the subaccount to which the schedule belongs.
  • id - optional string, if omitted a list of all schedules are returned.

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
    }
}

PUT

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.

  • customerid - optional string - customerid of the subaccount to which the schedule belongs.
  • id - required string - can be passed in the 'id' location of the URL
  • data - required JSON object containing the schedule (see the examples). Properties inside each day object are as follows:
    • time1 - start of time span
    • time2 - end of time span
    • exclude - inverts the time span so it is all day except for the time between time1 and time2
    • disabled - disables notifications for this day.
    • allday - enables notifications for the entire day.

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

Delete a schedule

  • customerid - optional string - customerid of the subaccount to which the schedule belongs.
  • id - required string - can be passed in the id position of the URL

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"}

If you have any questions, get in touch at support@nodeping.com, or use our Contact form.