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>

Obtaining rule data

PATCH

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

Changing the rule data

DELETE

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

Deleting a rule

LOOKUP

/rest/v1/uc/recordrules

Searching for the record rule identifier


Creating a new rule

Request

Field Description: recordrule entity

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

recordrule entity

Response

Field Description: recordrule entity

Response example
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 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/recordrules?offset=0&limit=2 HTTP/1.1

Response

Field Description: recordrule entity

Response example
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"
    }
  }
]

Obtaining rule 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/recordrules/cdffb0ae-016c-d2b3-e556-50e54938780c HTTP/1.1

Response

Field Description: recordrule entity

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

Changing the rule data

Fields prohibited for modification: id

Request

Field Description: recordrule entity

Request example
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

Response example
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

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

Response

Response example
HTTP/1.1 204 No Content

Searching for the record rule identifier

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

Key fields to search for: id

Request

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

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

Response

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

[
  "cdffb0ae-016c-d2b3-e556-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"
}