Alerts (alertcalls)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new notification
Request
Field Description: alertcall entity
POST /rest/v1/uc/alertcalls HTTP/1.1
Content-Type: application/json; charset=utf-8
alertcall entity
Response
Field Description: alertcall entity
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
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
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 in the list of resources to be issued. |
|
|
The maximum number of resources in the list. |
|
|
The sort order of the resources in the list. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/uc/alertcalls?offset=0&limit=2 HTTP/1.1
Response
Field Description: alertcall entity
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
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/uc/alertcalls/373a3d71-016c-d84c-0151-50e54938780c HTTP/1.1
Response
Field Description: alertcall entity
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
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
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"
}
}
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
LOOKUP /rest/v1/uc/alertcalls HTTP/1.1
Content-Type: application/json; charset=utf-8
"achtung190831"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"373a3d71-016c-d84c-0151-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}
See also
-
API /rest/v1/fs/targets/alertcall – management of alarm sound recording files.