Representation rules (representatives)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/representatives

Creating a new representation rule

GET

/rest/v1/uc/representatives

Getting the list of representation rules

GET

/rest/v1/uc/representatives/<id>

Getting representation rule data

PATCH

/rest/v1/uc/representatives/<id>

Modifying representation rule data

DELETE

/rest/v1/uc/representatives/<id>

Deleting a representation rule

LOOKUP

/rest/v1/uc/representatives

Searching for a representation rule identifier


Creating a new representation rule

Request

Field description: representative entity

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

representative entity

Response

Field description: representative entity

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

{
  "id": "9b64ae6e-016c-d737-bb5c-50e54938780c",
  "priority": 76,
  "dir": "cross",
  "ofdomain": "$.rootdomain.ru",
  "ofnumber": "XXX",
  "ofusername": "",
  "fordomain": "",
  "fornumber": "",
  "forusername": "",
  "action": "apply",
  "modifier": "5T",
  "moddisplay": "*",
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-28T07:54:09.62Z",
    "lwt": "2019-08-28T07:54:09.62Z"
  }
}

Getting the list of representation 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, ofdomain, ofusername, ofnumber, fordomain, forusername, fornumber, action, modifier, 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/representatives?offset=0&limit=2 HTTP/1.1

Response

Field description: representative entity

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

[
  {
    "id": "4f3fc6d5-016c-d738-96f2-50e54938780c",
    "priority": 75,
    "dir": "inner",
    "ofdomain": "",
    "ofnumber": "XXX",
    "ofusername": "",
    "fordomain": "$.rootdomain.ru",
    "fornumber": "",
    "forusername": "",
    "action": "apply",
    "modifier": "7XXX",
    "moddisplay": "",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-28T07:55:05.84Z",
      "lwt": "2019-08-28T07:55:05.84Z"
    }
  },
  {
    "id": "9b64ae6e-016c-d737-bb5c-50e54938780c",
    "priority": 76,
    "dir": "cross",
    "ofdomain": "$.rootdomain.ru",
    "ofnumber": "XXX",
    "ofusername": "",
    "fordomain": "",
    "fornumber": "",
    "forusername": "",
    "action": "apply",
    "modifier": "5T",
    "moddisplay": "",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-28T07:54:09.62Z",
      "lwt": "2019-08-28T07:54:09.62Z"
    }
  }
]

Getting representation 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/representatives/9b64ae6e-016c-d737-bb5c-50e54938780c HTTP/1.1

Response

Field description: representative entity

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

{
  "id": "9b64ae6e-016c-d737-bb5c-50e54938780c",
  "priority": 76,
  "dir": "cross",
  "ofdomain": "$.rootdomain.ru",
  "ofnumber": "XXX",
  "ofusername": "",
  "fordomain": "",
  "fornumber": "",
  "forusername": "",
  "action": "apply",
  "modifier": "5T",
  "moddisplay": "*",
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-28T07:54:09.62Z",
    "lwt": "2019-08-28T07:54:09.62Z"
  }
}

Modifying representation rule data

Fields prohibited for modification: id

Request

Field description: representative entity

Example request
PATCH /rest/v1/uc/representatives/9b64ae6e-016c-d737-bb5c-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

representative entity

Response

Field description: representative entity

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

{
  "id": "9b64ae6e-016c-d737-bb5c-50e54938780c",
  "priority": 77,
  "dir": "cross",
  "ofdomain": "test.rootdomain.ru",
  "ofnumber": "XXX",
  "ofusername": "",
  "fordomain": "",
  "fornumber": "",
  "forusername": "",
  "action": "apply",
  "modifier": "35T",
  "moddisplay": "*",
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-28T07:54:09.62Z",
    "lwt": "2019-09-09T08:56:14.39Z"
  }
}

Deleting a representation rule

Request

Example request
DELETE /rest/v1/uc/representatives/9b64ae6e-016c-d737-bb5c-50e54938780c HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for a representation 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/representatives HTTP/1.1
Content-Type: application/json; charset=utf-8

"4f3fc6d5-016c-d738-96f2-50e54938780c"

Response

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

[
  "4f3fc6d5-016c-d738-96f2-50e54938780c"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

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