Entity change log (changes)

Overview

Provides change log data from domain center entities based on the specified search conditions.

Each time a number of entities are created, modified, or deleted, information about the operation is recorded in the change log. This only occurs for descriptor entities marked in the specification as being served by the domain center.

It is not possible to retrieve all log changes. Requires at least one of the search terms to be specified. In some cases, it is required to specify a combination of conditions. The system prompts for the required fields in the body of the response if the composition of the conditions is not appropriate.

For example, you can search for all changes over a time interval, or all changes for a specific object.

Requests

HTTP verb Endpoint Description

GET

/rest/v1/journal/changes

Retrieving data from the log

Retrieving data from the log

Request

Table 1. Request parameters
Name Type Description

params

object

Search conditions in the change log. Fields of conditions object.

filter

object

Filter by field values of detected log entries.

mask

str

List of fields to output. Available fields for output: cmdtype, dtutc, modifierid, modifiername, objtype, objid, fields, obj.

To mask object fields (obj field values), they can be specified in flat format, for example: obj.id,obj.name,obj.opts.

offset

int

Offset in the list of resources to be issued. This is an additional offset relative to the offset in search conditions.

limit

int

The maximum number of resources in the list. This is an additional constraint relative to the constraint in search conditions

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Converts composite fields to a flat view. Applies to the object content - field value obj.

Table 2. Fields of the search conditions object
Name Type Description

dtstart

str

The date and time of the start of the interval.

In RFC3339 format in UTC, e.g. 2019-11-01-01T08:37:56Z. Other value formats are also suitable, they are automatically cast to the required value.

dtstop

str

The date and time of the start of the interval.

In RFC3339 format in UTC, e.g. 2019-11-01-01T08:37:56Z. Other value formats are also suitable, they are automatically cast to the required value.

cmdtype

str

Filter on the type of operation:

  • "create" – object created;

  • "update" – object changed;

  • "delete" – object deleted.

objtype

str

Filter on type entities. For example "user" or "ivrscript".

Applies in conjunction with one of the objid conditions and the objkey.

objid

str

Filter on the object identifier.

For entities that have an identifier.

Applies in conjunction with the objtype condition. Cannot be used in conjunction with objkey.

objkey

str

Filter on an object’s key field.

For entities that do not have an identifier.

Applies in conjunction with the objtype condition. Cannot be used in conjunction with objkey.

offset

int

Offset when issuing data from the database.

limit

int

Limiting the amount of data output from the database.

Request example
GET /rest/v1/journal/changes?params={"objtype":"user","objid":"3063e0ff-2ce8-2f4e-f5e0-00241dd9a031"} HTTP/1.1

Response

Table 3. Fields of the search conditions object
Name Description

cmdtype

Type of object operation. Value options:

  • "create" – object created;

  • "update" – object changed;

  • "delete" – object deleted.

dtutc

The date-time of the transaction. RFC3339 format in UTC.

modifierid

Identifier of the user account on behalf of which the operation was performed.

modifiername

The name of the user account on behalf of which the operation was performed. Fixed at the time of the transaction.

objtype

Type entities. For example "user" or "ivrscript".

objid

The identifier or key field of an entity.

fields

A string with the names of the object fields in which the values have been changed. The fields are listed separated by commas. The values of composite fields by first-level keys are specified in flat mode, e.g. opts.roles.

The field is present only in operation objects "update".

obj

Full content of the facility, similar to the issuance of the facility through the API.

For operations

  • "create" and "update" - the value of the object after the operation is given.

  • "delete" – is the value of the object before the operation.

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

[
  {
    "cmdtype": "update",
    "dtutc": "2019-11-01T06:35:03.343Z",
    "modifierid": "71374fef-42f1-4e49-2069-faab905d4be2",
    "modifiername": "Administrator",
    "objtype": "user",
    "objid": "3063e0ff-2ce8-2f4e-f5e0-00241dd9a031",
    "fields": "name,opts.roles",
    "obj": {
      "id": "3063e0ff-2ce8-2f4e-f5e0-00241dd9a031",
      "login": "ivanov",
      "name": "Ivanov Alexey",
      "pwd": "*****",
      "timezone": "default",
      "opts": {
        "roles": ["admin"]
      },
      "ext": {
        "a": "1",
        "b": "asdfasdf",
        "c": 555.2,
        "d": 10,
        "e": {
          "x": 1,
          "y": "2",
          "z": false
        },
        "ct": "2019-08-01T07:02:01.52Z",
        "lwt": "2019-11-01T06:35:03.31Z"
      }
    }
  },
  {
    "cmdtype": "update",
    "dtutc": "2019-08-01T07:02:15.951Z",
    "modifierid": "71374fef-42f1-4e49-2069-faab905d4be2",
    "modifiername": "Administrator",
    "objtype": "user",
    "objid": "3063e0ff-2ce8-2f4e-f5e0-00241dd9a031",
    "fields": "opts.roles",
    "obj": {
      "id": "3063e0ff-2ce8-2f4e-f5e0-00241dd9a031",
      "login": "ivanov",
      "name": "Ivanov A",
      "pwd": "*****",
      "timezone": "default",
      "opts": {
        "roles": ["user"]
      },
      "ext": {
        "a": "1",
        "b": "asdfasdf",
        "c": 555.2,
        "d": 10,
        "e": {
          "x": 1,
          "y": "2",
          "z": false
        },
        "ct": "2019-08-01T07:02:01.52Z",
        "lwt": "2019-08-01T07:02:15.95Z"
      }
    }
  },
  {
    "cmdtype": "create",
    "dtutc": "2019-08-01T07:02:01.530Z",
    "modifierid": "71374fef-42f1-4e49-2069-faab905d4be2",
    "modifiername": "Administrator",
    "objtype": "user",
    "objid": "3063e0ff-2ce8-2f4e-f5e0-00241dd9a031",
    "obj": {
      "id": "3063e0ff-2ce8-2f4e-f5e0-00241dd9a031",
      "login": "ivanov",
      "name": "Ivanov A",
      "pwd": "*****",
      "timezone": "default",
      "opts": {},
      "ext": {
        "a": "1",
        "b": "asdfasdf",
        "c": 555.2,
        "d": 10,
        "e": {
          "x": 1,
          "y": "2",
          "z": false
        },
        "ct": "2019-08-01T07:02:01.52Z",
        "lwt": "2019-08-01T07:02:01.52Z"
      }
    }
  }
]

See also