Group numbers (sipgroups)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/sipgroups

Creating a new group number

GET

/rest/v1/uc/sipgroups

Getting the list of group numbers

GET

/rest/v1/uc/sipgroups/<id>

Getting data of group number

PATCH

/rest/v1/uc/sipgroups/<id>

Modifying data of group number

DELETE

/rest/v1/uc/sipgroups/<id>

Deleting group number

LOOKUP

/rest/v1/uc/sipgroups

Searching for the identifier of group number


Creating a new group number

Request

Field description: group entity

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

group entity

Response

Field description: group entity

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

{
  "id": "ba18a3e4-016c-d758-54da-50e54938780c",
  "phonenumber": "500",
  "type": "cascade",
  "dialplan": [
    {
      "dial": ["511"],
      "timeout": 10000
    },
    {
      "dial": ["512", "513"]
    }
  ],
  "pickup": 1,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-28T08:29:46.74Z",
    "lwt": "2019-08-28T08:29:46.74Z"
  }
}

Getting the list of group numbers

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, phonenumber, type, dialplan, pickup, 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/sipgroups?offset=0&limit=2 HTTP/1.1

Response

Field description: group entity

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

[
  {
    "id": "495079be-016c-d757-e913-50e54938780c",
    "phonenumber": "200",
    "type": "random",
    "dialplan": [
      {"dial": ["211", "212"]}
    ],
    "pickup": 0,
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-28T08:29:18.48Z",
      "lwt": "2019-08-28T08:29:18.48Z"
    }
  },
  {
    "id": "ba18a3e4-016c-d758-54da-50e54938780c",
    "phonenumber": "500",
    "type": "random",
    "dialplan": [
      {"dial": ["511"]},
      {"dial": ["511", "512"]}
    ],
    "pickup": 1,
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-28T08:29:46.74Z",
      "lwt": "2019-09-08T12:13:55.01Z"
    }
  }
]

Getting data of group number

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/sipgroups/ba18a3e4-016c-d758-54da-50e54938780c HTTP/1.1

Response

Field description: group entity

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

{
  "id": "ba18a3e4-016c-d758-54da-50e54938780c",
  "phonenumber": "500",
  "type": "cascade",
  "dialplan": [
    {
      "dial": ["511"],
      "timeout": 10000
    },
    {
      "dial": ["512", "513"]
    }
  ],
  "pickup": 1,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-28T08:29:46.74Z",
    "lwt": "2019-08-28T08:29:46.74Z"
  }
}

Modifying data of group number

Fields prohibited for modification: id

Request

Field description: group entity

Example request
PATCH /rest/v1/uc/sipgroups/ba18a3e4-016c-d758-54da-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

group entity

Response

Field description: group entity

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

{
  "id": "ba18a3e4-016c-d758-54da-50e54938780c",
  "phonenumber": "500",
  "type": "parallel",
  "dialplan": [
    {"dial": ["511"]},
    {"dial": ["512"]},
    {"dial": ["513"]}
  ],
  "pickup": 1,
  "opts": {
"title": "Marketing Department",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-28T08:29:46.74Z",
    "lwt": "2019-09-08T12:38:24.39Z"
  }
}

Deleting group number

Request

Example request
DELETE /rest/v1/uc/sipgroups/ba18a3e4-016c-d758-54da-50e54938780c HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for the identifier of group number

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

Key fields for search: id, phonenumber

Request

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

"500"

Response

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

[
  "ba18a3e4-016c-d758-54da-50e54938780c"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

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