Recording rules (recordrules)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/recordrules

Creating a new rule

GET

/rest/v1/uc/recordrules

Getting the list of rules

GET

/rest/v1/uc/recordrules/<id>

Getting rule data

PATCH

/rest/v1/uc/recordrules/<id>

Modifying rule data

DELETE

/rest/v1/uc/recordrules/<id>

Deleting a rule

LOOKUP

/rest/v1/uc/recordrules

Searching for a recording rule identifier


Creating a new rule

Request

Field description: recordrule entity

Example request
POST /rest/v1/uc/recordrules HTTP/1.1
Content-Type: application/json; charset=utf-8

recordrule entity

Response

Field description: recordrule entity

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

{
  "id": "cdffb0ae-016c-d2b3-e556-50e54938780c",
  "priority": 99,
  "dir": "",
  "fromnumber": "",
  "tonumber": "",
  "crossdomain": "",
  "rec": 1,
  "storageruleid": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
  "siprec": 0,
  "streamed_call_rec": 0,
  "mixed_call_rec": 0,
  "schedule": "work",
  "periods": [],
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2019-08-27T10:51:40.75Z",
    "lwt": "2019-08-27T10:51:40.75Z"
  }
}

Getting the list of rules

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, priority, dir, fromnumber, tonumber, crossdomain, rec, siprec, streamed_call_rec, mixed_call_rec, storageid, schedule, opts.title, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/uc/recordrules?offset=0&limit=2 HTTP/1.1

Response

Field description: recordrule entity

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

[
  {
    "id": "06839f04-016c-d2b4-70ce-50e54938780c",
    "priority": 50,
    "dir": "incoming",
    "fromnumber": "",
    "tonumber": "",
    "crossdomain": "",
    "rec": 1,
    "storageruleid": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
    "siprec": 0,
    "streamed_call_rec": 0,
    "mixed_call_rec": 0,
    "schedule": "work",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-27T10:52:16.46Z",
      "lwt": "2019-08-27T10:52:16.46Z"
    }
  },
  {
    "id": "cdffb0ae-016c-d2b3-e556-50e54938780c",
    "priority": 99,
    "dir": "",
    "fromnumber": "",
    "tonumber": "",
    "crossdomain": "*",
    "rec": 1,
    "storageruleid": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
    "siprec": 0,
    "streamed_call_rec": 0,
    "mixed_call_rec": 0,
    "schedule": "work",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-27T10:51:40.75Z",
      "lwt": "2019-08-27T10:51:40.75Z"
    }
  }
]

Getting rule data

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/uc/recordrules/cdffb0ae-016c-d2b3-e556-50e54938780c HTTP/1.1

Response

Field description: recordrule entity

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

{
  "id": "cdffb0ae-016c-d2b3-e556-50e54938780c",
  "priority": 99,
  "dir": "",
  "fromnumber": "",
  "tonumber": "",
  "crossdomain": "",
  "rec": 1,
  "storageruleid": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
  "siprec": 0,
  "streamed_call_rec": 0,
  "mixed_call_rec": 0,
  "schedule": "work",
  "periods": [],
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-27T10:51:40.75Z",
    "lwt": "2019-08-27T10:51:40.75Z"
  }
}

Modifying rule data

Fields prohibited for modification: id

Request

Field description: recordrule entity

Example request
PATCH /rest/v1/uc/recordrules/cdffb0ae-016c-d2b3-e556-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

recordrule entity

Response

Field description: recordrule entity

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

{
  "id": "cdffb0ae-016c-d2b3-e556-50e54938780c",
  "priority": 99,
  "dir": "inner",
  "fromnumber": "101",
  "tonumber": "115",
  "crossdomain": "*",
  "rec": 0,
  "storageruleid": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
  "siprec": 0,
  "streamed_call_rec": 0,
  "mixed_call_rec": 0,
  "schedule": "all",
  "periods": [],
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-27T10:51:40.75Z",
    "lwt": "2019-09-09T09:38:59.35Z"
  }
}

Deleting a rule

Request

Example request
DELETE /rest/v1/uc/recordrules/cdffb0ae-016c-d2b3-e556-50e54938780c HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for a recording rule identifier

Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.

Key fields for search: id

Request

Example request
LOOKUP /rest/v1/uc/recordrules HTTP/1.1
Content-Type: application/json; charset=utf-8

"cdffb0ae-016c-d2b3-e556-50e54938780c"

Response

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

[
  "cdffb0ae-016c-d2b3-e556-50e54938780c"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

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