Child domains (domains)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/domain/domains

Creating a new child domain

GET

/rest/v1/domain/domains

Getting the list of child domains

GET

/rest/v1/domain/domains/<id>

Getting child domain data

PATCH

/rest/v1/domain/domains/<id>

Modifying child domain data

DELETE

/rest/v1/domain/domains/<id>

Deleting a child domain

LOOKUP

/rest/v1/domain/domains

Searching for a child domain identifier


Creating a new child domain

Request

Field description: domain entity

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

domain entity

Response

Field description: domain entity

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

{
  "id": "521944bd-016c-b839-648f-50e54938780c",
  "name": "x.docs.rootdomain.ru",
  "dbdefaultconn": 1,
  "dbhost": "",
  "dblogin": "",
  "dbport": 0,
  "dbpwd": "",
  "lic": {
    "domains": 100,
    "devices": 1000,
    "siptrunks": 5000
  },
  "opts": {
    "title": "",
    "comment": "",
    "isblocked": false,
    "script_pause_between_components": 0,
    "script_limit_component_count": -1,
    "script_limit_site_count": -1,
    "script_duration_sec": -1,
    "script_allow_global_variables": true
  },
  "ext": {
    "ct": "2019-08-22T07:27:44.55Z",
    "lwt": "2019-08-22T07:27:44.55Z"
  }
}

Getting the list of child domains

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, name, lic, opts.title, opts.isblocked, opts.script_pause_between_components, opts.script_limit_component_count, opts.script_limit_site_count, opts.script_duration_sec, opts.script_allow_global_variables, 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/domain/domains?filter={"opts.isblocked":"false"}&offset=0&limit=2 HTTP/1.1

Response

Field description: domain entity

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

[
  {
    "id": "521944bd-016c-b839-648f-50e54938780c",
    "name": "x.docs.rootdomain.ru",
    "lic": {
      "domains": 100,
      "devices": 1000,
      "siptrunks": 5000
    },
    "opts": {
      "title": "",
      "isblocked": false,
      "script_pause_between_components": 0,
      "script_limit_component_count": -1,
      "script_limit_site_count": -1,
      "script_duration_sec": -1,
      "script_allow_global_variables": true
    },
    "ext": {
      "ct": "2019-08-22T07:27:44.55Z",
      "lwt": "2019-08-22T07:27:44.55Z"
    }
  },
  {
    "id": "2676d846-016c-b839-d915-50e54938780c",
    "name": "y.docs.rootdomain.ru",
    "lic": {
      "domains": 2
    },
    "opts": {
      "title": "",
      "isblocked": false,
      "script_pause_between_components": 0,
      "script_limit_component_count": -1,
      "script_limit_site_count": -1,
      "script_duration_sec": -1,
      "script_allow_global_variables": true
    },
    "ext": {
      "ct": "2019-08-22T07:28:14.61Z",
      "lwt": "2019-08-22T07:28:14.61Z"
    }
  }
]

Getting child domain 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/domain/domains/521944bd-016c-b839-648f-50e54938780c HTTP/1.1

Response

Field description: domain entity

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

{
  "id": "521944bd-016c-b839-648f-50e54938780c",
  "name": "x.docs.rootdomain.ru",
  "dbdefaultconn": 1,
  "dbhost": "",
  "dblogin": "",
  "dbport": 0,
  "dbpwd": "",
  "lic": {
    "domains": 100,
    "devices": 1000,
    "siptrunks": 5000
  },
  "opts": {
    "title": "",
    "comment": "",
    "isblocked": false,
    "script_pause_between_components": 0,
    "script_limit_component_count": -1,
    "script_limit_site_count": -1,
    "script_duration_sec": -1,
    "script_allow_global_variables": true
  },
  "ext": {
    "ct": "2019-08-22T07:27:44.55Z",
    "lwt": "2019-08-22T07:27:44.55Z"
  }
}

Modifying child domain data

Fields prohibited for modification: id, name

Request

Field description: domain entity

Example request
PATCH /rest/v1/domain/domains/521944bd-016c-b839-648f-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

domain entity

Response

Field description: domain entity

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

{
  "id": "521944bd-016c-b839-648f-50e54938780c",
  "name": "x.docs.rootdomain.ru",
  "dbdefaultconn": 1,
  "dbhost": "",
  "dblogin": "",
  "dbport": 0,
  "dbpwd": "",
  "lic": {
    "domains": 120,
    "devices": 1200,
    "siptrunks": 5500
  },
  "opts": {
    "title": "",
    "comment": "",
    "isblocked": false,
    "script_pause_between_components": 1,
    "script_limit_component_count": 100,
    "script_limit_site_count": 100,
    "script_duration_sec": 60,
    "script_allow_global_variables": false
  },
  "ext": {
    "ct": "2019-08-22T07:27:44.55Z",
    "lwt": "2019-09-10T21:35:27.41Z"
  }
}

Deleting a child domain

Request

Example request
DELETE /rest/v1/domain/domains/521944bd-016c-b839-648f-50e54938780c HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for a child domain identifier

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

Key fields for search: id, name

Request

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

"x.docs.rootdomain.ru"

Response

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

[
  "521944bd-016c-b839-648f-50e54938780c"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

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

Contents (child resources)