SIP users (sipusers)

Overview

Manages telephony provider accounts.

The account password (the 'pwd' field) is returned only to administrators and is not returned to other users with roles granting read access to the collection.

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/sipusers

Creating a new SIP user

GET

/rest/v1/uc/sipusers

Getting the list of SIP users

GET

/rest/v1/uc/sipusers/<id>

Getting SIP user data

PATCH

/rest/v1/uc/sipusers/<id>

Modifying SIP user data

DELETE

/rest/v1/uc/sipusers/<id>

Deleting a SIP user

LOOKUP

/rest/v1/uc/sipusers

Searching for a SIP user identifier


Creating a new SIP user

Request

Field description: sipuser entity

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

sipuser entity

Response

Field description: sipuser entity

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

{
  "id": "0007f945-016c-b373-2772-50e54938780c",
  "name": "sip4",
  "login": "sip4",
  "pwd": "pwd_sip4",
  "phonenumber": "14",
  "reg": 1,
  "devices": [],
  "iduser": "00000000-0000-0000-0000-000000000000",
  "lic": {
    "devices": 2
  },
  "timezone": "default",
  "opts": {
    "title": "",
    "comment": "",
    "ap_device_model": "Yealink SIP-T21P_E2",
    "ap_mac_address": "805EC0D525CA",
    "calltimesec": 30,
    "dlgtimesec": 0,
    "trunks": -1,
    "maxexpires": 3600,
    "minexpires": 30,
    "modextin": "",
    "modextout": "",
    "parallel": ["898765432100"]
  },
  "ext": {
    "ct": "2019-08-21T09:12:44.14Z",
    "lwt": "2019-08-21T09:12:44.14Z"
  }
}

Getting the list of SIP users

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, login, phonenumber, reg, iduser, opts.modextin, opts.modextout, opts.trunks, 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/sipusers?offset=0&limit=2 HTTP/1.1

Response

Field description: sipuser entity

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

[
  {
    "id": "b6edc9b1-016c-b372-63a5-50e54938780c",
    "name": "SIP1-{D}",
    "login": "sip1",
    "phonenumber": "11",
    "reg": 1,
    "iduser": "00000000-0000-0000-0000-000000000000",
    "opts": {
      "trunks": -1,
      "modextin": "",
      "modextout": "",
      "parallel": ["89274137274","*9311"]
    },
    "ext": {
      "ct": "2019-08-21T09:11:54.20Z",
      "lwt": "2019-08-21T09:11:54.20Z"
    }
  },
  {
    "id": "610e09f3-016c-b372-b4da-50e54938780c",
    "name": "sip2",
    "login": "SIP2-{D}",
    "phonenumber": "12",
    "reg": 1,
    "iduser": "00000000-0000-0000-0000-000000000000",
    "opts": {
      "ap_mac_address": "805EC0D524E1",
      "trunks": -1,
      "modextin": "",
      "modextout": "",
      "parallel": []
    },
    "ext": {
      "ct": "2019-08-21T09:12:14.81Z",
      "lwt": "2019-08-21T09:12:14.81Z"
    }
  }
]

Getting SIP user 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/sipusers/0007f945-016c-b373-2772-50e54938780c HTTP/1.1

Response

Field description: sipuser entity

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

{
  "id": "0007f945-016c-b373-2772-50e54938780c",
  "name": "sip4",
  "login": "sip4",
  "pwd": "pwd_sip4",
  "phonenumber": "14",
  "reg": 1,
  "devices": [],
  "iduser": "00000000-0000-0000-0000-000000000000",
  "lic": {
    "devices": 2
  },
  "timezone": "default",
  "opts": {
    "title": "",
    "comment": "",
    "ap_device_model": "Yealink SIP-T21P_E2",
    "ap_mac_address": "805EC0D525CA",
    "calltimesec": 30,
    "dlgtimesec": 0,
    "trunks": -1,
    "maxexpires": 3600,
    "minexpires": 30,
    "modextin": "",
    "modextout": "",
    "parallel": ["898765432100"]
  },
  "ext": {
    "ct": "2019-08-21T09:12:44.14Z",
    "lwt": "2019-08-21T09:12:44.14Z"
  }
}

Modifying SIP user data

Fields prohibited for modification: id

Request

Field description: sipuser entity

Example request
PATCH /rest/v1/uc/sipusers/0007f945-016c-b373-2772-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

sipuser entity

Response

Field description: sipuser entity

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

{
  "id": "0007f945-016c-b373-2772-50e54938780c",
  "name": "sip4",
  "login": "sip4",
  "pwd": "pwd_sip4",
  "phonenumber": "14",
  "reg": 1,
  "devices": [],
  "iduser": "00000000-0000-0000-0000-000000000000",
  "lic": {
    "devices": 2
  },
  "timezone": "default",
  "opts": {
    "title": "",
    "comment": "",
    "ap_device_model": "Yealink SIP-T21P_E2",
    "ap_mac_address": "805EC0D525CA",
    "calltimesec": 30,
    "dlgtimesec": 0,
    "trunks": -1,
    "maxexpires": 3600,
    "minexpires": 30,
    "modextin": "",
    "modextout": "",
    "parallel": ["898765432100"]
  },
  "ext": {
    "ct": "2019-08-21T09:12:44.14Z",
    "lwt": "2019-09-07T16:25:03.01Z"
  }
}

Deleting a SIP user

Request

Example request
DELETE /rest/v1/uc/sipusers/0007f945-016c-b373-2772-50e54938780c HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for a SIP user identifier

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

Key fields for search: id, login, phonenumber

Request

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

"11"

Response

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

[
  "b6edc9b1-016c-b372-63a5-50e54938780c"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

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