API Version: Development
System-Admin
, Company-Admin
or Nightmode
permissions./rest/dialplan/read/
{
"type": "nm",
"scope": {
"company": ["company-id", ...]
}
}
{
"type": "nm",
"scope": {
"company": ["default"]
}
}
{
"result": "success",
"values": {
"default": {
1: "sched",
2: "sched",
3: "sched",
4: "sched",
5: "sched",
6: "sched",
7: "on",
8: "off",
9: "sched",
10: "sched"
}
}
}
/rest/dialplan/update/
{
"type": "nm",
"scope": {
"company": ["company-id", ...]
},
"values": {
"1": "on" or "off" or "sched",
... missing values unchanged ...
"10": "on" or "off" or "sched"
}
}
{
"type": "nm",
"scope": {
"company": ["default"]
},
"values": {
"2": "off",
"3": "on",
"4": "sched"
}
}
/rest/dialplan/readnames/
{
"type": "nm",
"scope": {
"company": ["company-id", ...]
}
}
{
"result": "success",
"values": {
"company id": [
"Nightmode zero name",
...
],
...
}
}
{
"type": "nm",
"scope": {
"company": [
"default",
"office"
]
}
}
{
"result": "success",
"values": {
"default": [
"Secretarial",
null,
"Medical"
],
"office": [
"open hours",
"lunchtime"
]
}
}
/rest/dialplan/readcal/
{
"type": "nm",
"scope": {
"company": ["company-id", ...]
}
}
{
"result": "success",
"values": {
"company id": [
{
"owner_id": company-owner-id,
"event_type": "NMCAL",
"event_id": unique-event-id,
"event_instance": "nightmode-num-affected",
"event_repeat": "NEVER|DAY|WEEK|MONTH|YEAR",
"event_start": epoch-milliseconds-next-event-starts,
"event_end": epoch-milliseconds-next-event-ends,
"event_action": "ON|OFF",
"event_last": epoch-milliseconds-event-expires
},
...
],
...
}
}
{
"type": "nm",
"scope": {
"company": [
"default"
]
}
}
{
"result": "success",
"values": {
"default": [
{
"owner_id": 7,
"event_type": "NMCAL",
"event_id": 844,
"event_instance": "1",
"event_repeat": "YEAR",
"event_start": 1545696000000,
"event_end": 1577350800000,
"event_action": "ON",
"event_last": null
},
{
"owner_id": 7,
"event_type": "NMCAL",
"event_id": 848,
"event_instance": "3",
"event_repeat": "YEAR",
"event_start": 1545696000000,
"event_end": 1577350800000,
"event_action": "ON",
"event_last": null
},
{
"owner_id": 7,
"event_type": "NMCAL",
"event_id": 849,
"event_instance": "0",
"event_repeat": "NEVER",
"event_start": 1514160000000,
"event_end": 1514278800000,
"event_action": "OFF",
"event_last": null
}
]
}
}
/rest/dialplan/createcal/
{
"type": "nm",
"values": {
"company": "company-id",
"instance": nightmode-number,
"start": start-date-of-event,
"end": end-date-of-event,
"last": event-expiry (optional),
"repeat": "NEVER|DAY|WEEK|MONTH|YEAR",
"action": "ON|OFF"
}
}
{
"result": "success",
"event_id": event_id,
"owner_id": owner_id
}
{
"type": "nm",
"values": {
"company": "test",
"instance": 3,
"start": 1536487200000,
"end": 1559419200000,
"last": null,
"repeat": "YEAR",
"action": "ON"
}
}
{
"result": "success",
"event_id": 1234,
"owner_id": 567
}
/rest/dialplan/deletecal/
{
"type": "nm",
"scope": {
"event_id": [event-id, ...]
}
}
{
"result": "success",
"numrows": number-of-entries-deleted
}