Rules for access to subscriber functions (featurerules)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/featurerules

Creating a new rule

GET

/rest/v1/uc/featurerules

Getting the list of rules

GET

/rest/v1/uc/featurerules/<id>

Obtaining rule data

PATCH

/rest/v1/uc/featurerules/<id>

Changing the rule data

DELETE

/rest/v1/uc/featurerules/<id>

Deleting a rule


Creating a new rule

Request

Field Description: featurerule entity

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

featurerule entity

Response

Field Description: featurerule entity

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

{
  "id": "be95db11-0186-7a1b-9d21-7cd30a921f58",
  "name": "num 14",
  "enabled": true,
  "filter_from": "14",
  "filter_to": "*",
  "priority": "115",
  "types": [
    "intercom",
    "pickup",
    "blf",
    "blf_details"
  ],
  "opts": {
    "comment": "",
    "tab": [],
    "title": ""
  },
  "ext": {
    "ct": "2023-02-22T17:11:15.487Z",
    "lwt": "2023-02-22T17:11:28.983Z"
  }
}

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, prefix, type, extension, priority, 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/featurerules?filter={"type":"ivr"}&offset=0&limit=2 HTTP/1.1

Response

Field Description: featurerule entity

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

[
  {
    "id": "be95db11-0186-7a1b-9d21-7cd30a921f58",
    "name": "num 14",
    "enabled": true,
    "filter_from": "14",
    "filter_to": "*",
    "priority": "115",
    "types": [
      "intercom",
      "pickup",
      "blf",
      "blf_details"
    ],
    "opts": {
      "comment": "",
      "title": ""
    },
    "ext": {
      "ct": "2023-02-22T17:11:15.487Z",
      "lwt": "2023-02-22T17:11:28.983Z"
    }
  }
]

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/featurerules/dccd337a-016c-d1cf-7393-50e54938780c HTTP/1.1

Response

Field Description: featurerule entity

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

{
  "id": "be95db11-0186-7a1b-9d21-7cd30a921f58",
  "name": "num 14",
  "enabled": true,
  "filter_from": "14",
  "filter_to": "*",
  "priority": "115",
  "types": [
    "intercom",
    "pickup",
    "blf",
    "blf_details"
  ],
  "opts": {
    "comment": "",
    "tab": [],
    "title": ""
  },
  "ext": {
    "ct": "2023-02-22T17:11:15.487Z",
    "lwt": "2023-02-22T17:11:28.983Z"
  }
}

Changing the rule data

Fields prohibited for modification: id

Request

Field Description: featurerule entity

Request example
PATCH /rest/v1/uc/featurerules/c0d66244-016c-b869-ead9-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

featurerule entity

Response

Field Description: featurerule entity

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

{
  "id": "be95db11-0186-7a1b-9d21-7cd30a921f58",
  "name": "num 14",
  "enabled": true,
  "filter_from": "14",
  "filter_to": "*",
  "priority": "115",
  "types": [
    "intercom",
    "pickup",
    "blf",
    "blf_details"
  ],
  "opts": {
    "comment": "",
    "tab": [],
    "title": ""
  },
  "ext": {
    "ct": "2023-02-22T17:11:15.487Z",
    "lwt": "2023-02-22T17:11:28.983Z"
  }
}

Deleting a rule

Request

Request example
DELETE /rest/v1/uc/featurerules/c0d66244-016c-b869-ead9-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content