Alerts (alertcalls)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/alertcalls

Creating a new notification

GET

/rest/v1/uc/alertcalls

Getting the list of alerts

GET

/rest/v1/uc/alertcalls/<id>

Receiving alert data

PATCH

/rest/v1/uc/alertcalls/<id>

Changing notification data

DELETE

/rest/v1/uc/alertcalls/<id>

Deleting an alert

LOOKUP

/rest/v1/uc/alertcalls

Searching for a notification identifier


Creating a new notification

Request

Field Description: alertcall entity

Request example
POST /rest/v1/uc/alertcalls HTTP/1.1
Content-Type: application/json; charset=utf-8

alertcall entity

Response

Field Description: alertcall entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "373a3d71-016c-d84c-0151-50e54938780c",
  "code": "achtung190831",
  "name": "Alert 31.08.19",
  "dtstart": "2019-08-31T12:55:32Z",
  "dtstop": "",
  "ivrscriptcode": "alert_no_ack",
  "mediafile": "test_sound.wav",
  "groups": [],
  "abonents": [
    1,
    2
  ],
  "opts": {
    "comment": "",
    "site": "SITE1",
    "attemptcount": 1,
    "attempttimeoutsec": 10,
    "callerid": "100",
    "callername": "AlertMachine",
    "calltimeout": 30,
    "trunkcount": 1,
    "status": "planned",
    "statresults": {},
    "dtstarted": "",
    "dtstopped": ""
  },
  "ext": {
    "ct": "2019-08-28T12:55:55.47Z",
    "lwt": "2019-08-28T12:55:55.47Z"
  }
}

Getting the list of alerts

Request

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, code, name, dtstart, dtstop, ivrscriptcode, mediafile, opts.site, opts.attemptcount, opts.attempttimeoutsec, opts.callerid, opts.callername, opts.calltimeout, opts.trunkcount, opts.status, opts.statresults, opts.dtstarted, opts.dtstopped, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/uc/alertcalls?offset=0&limit=2 HTTP/1.1

Response

Field Description: alertcall entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "1484fd72-016c-d819-06b5-50e54938780c",
    "code": "test_alert",
    "name": "Alert 31.08.19",
    "dtstart": "2019-09-08T15:25:50Z",
    "dtstop": "",
    "ivrscriptcode": "alert_no_ack",
    "mediafile": "test_sound.wav",
    "opts": {
      "site": "SITE1",
      "attemptcount": 1,
      "attempttimeoutsec": 10,
      "callerid": "100",
      "callername": "AlertMachine",
      "calltimeout": 30,
      "trunkcount": 2,
      "status": "cancelled",
      "statresults": {
        "answered": 1,
        "approved": 1,
        "finished": 2,
        "incall": 0,
        "indelay": 1,
        "new": 0,
        "prepared": 0,
        "total": 3
      },
      "dtstarted": "2019-09-08T15:25:51.43Z",
      "dtstopped": "2019-09-08T15:27:00.54Z"
    },
    "ext": {
      "ct": "2019-08-28T12:00:14.51Z",
      "lwt": "2019-08-28T12:00:14.51Z"
    }
  },
  {
    "id": "373a3d71-016c-d84c-0151-50e54938780c",
    "code": "achtung190831",
    "name": "Alert 31.08.19",
    "dtstart": "2019-08-31T12:55:32Z",
    "dtstop": "",
    "ivrscriptcode": "alert_no_ack",
    "mediafile": "test_sound.wav",
    "opts": {
      "site": "SITE1",
      "attemptcount": 1,
      "attempttimeoutsec": 10,
      "callerid": "100",
      "callername": "AlertMachine",
      "calltimeout": 30,
      "trunkcount": 1,
      "status": "planned",
      "statresults": {},
      "dtstarted": "",
      "dtstopped": ""
    },
    "ext": {
      "ct": "2019-08-28T12:55:55.47Z",
      "lwt": "2019-08-28T12:55:55.47Z"
    }
  }
]

Receiving alert data

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/uc/alertcalls/373a3d71-016c-d84c-0151-50e54938780c HTTP/1.1

Response

Field Description: alertcall entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "373a3d71-016c-d84c-0151-50e54938780c",
  "code": "achtung190831",
  "name": "Alert 31.08.19",
  "dtstart": "2019-08-31T12:55:32Z",
  "dtstop": "",
  "ivrscriptcode": "alert_no_ack",
  "mediafile": "test_sound.wav",
  "groups": [],
  "abonents": [
    1,
    2
  ],
  "opts": {
    "comment": "",
    "site": "SITE1",
    "attemptcount": 1,
    "attempttimeoutsec": 10,
    "callerid": "100",
    "callername": "AlertMachine",
    "calltimeout": 30,
    "trunkcount": 1,
    "status": "planned",
    "statresults": {},
    "dtstarted": "",
    "dtstopped": ""
  },
  "ext": {
    "ct": "2019-08-28T12:55:55.47Z",
    "lwt": "2019-08-28T12:55:55.47Z"
  }
}

Changing notification data

Fields prohibited for modification: id

Request

Field Description: alertcall entity

Request example
PATCH /rest/v1/uc/alertcalls/373a3d71-016c-d84c-0151-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

alertcall entity

Response

Field Description: alertcall entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "373a3d71-016c-d84c-0151-50e54938780c",
  "code": "achtung190831",
  "name": "Alert 31.08.19",
  "dtstart": "2019-08-31T12:55:32Z",
  "dtstop": "",
  "ivrscriptcode": "alert_no_ack",
  "mediafile": "test_sound.wav",
  "groups": [
    "group01",
    "group02"
  ],
  "abonents": [
    1,
    2
  ],
  "opts": {
    "comment": "",
    "site": "SITE1",
    "attemptcount": 1,
    "attempttimeoutsec": 10,
    "callerid": "100",
    "callername": "AlertMachine",
    "calltimeout": 30,
    "trunkcount": 1,
    "status": "planned",
    "statresults": {},
    "dtstarted": "",
    "dtstopped": ""
  },
  "ext": {
    "ct": "2019-08-28T12:55:55.47Z",
    "lwt": "2019-09-09T17:23:10.55Z"
  }
}

Deleting an alert

Request

Request example
DELETE /rest/v1/uc/alertcalls/373a3d71-016c-d84c-0151-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Searching for a notification identifier

Searches the resource for the specified key, returns the identifier(s) to build the endpoint.

Key fields to search for: id, code, name

Request

Request example
LOOKUP /rest/v1/uc/alertcalls HTTP/1.1
Content-Type: application/json; charset=utf-8

"achtung190831"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "373a3d71-016c-d84c-0151-50e54938780c"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}

See also