SIP-users (sipusers)

Overview

Manages telephony provider accounts.

The account password (the 'pwd' field) is only given to administrators when reading and is not given to other users with roles that authorize them to read 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>

Obtaining SIP user data

PATCH

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

Changing SIP user data

DELETE

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

Deleting a SIP user

LOOKUP

/rest/v1/uc/sipusers

Searching for SIP user ID


Creating a new SIP user

Request

Field Description: sipuser entity

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

sipuser entity

Response

Field Description: sipuser entity

Response example
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 be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/uc/sipusers?offset=0&limit=2 HTTP/1.1

Response

Field Description: sipuser entity

Response example
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"
    }
  }
]

Obtaining SIP user data

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/uc/sipusers/0007f945-016c-b373-2772-50e54938780c HTTP/1.1

Response

Field Description: sipuser entity

Response example
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"
  }
}

Changing SIP user data

Fields prohibited for modification: id

Request

Field Description: sipuser entity

Request example
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

Response example
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

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

Response

Response example
HTTP/1.1 204 No Content

Searching for SIP user ID

Searches the resource for the specified key, returns the identifier(s) to build the endpoint.

Key fields to search for: id, login, phonenumber

Request

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

"11"

Response

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

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

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