Accounts of SIP telephony providers (providers)

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/providers

Creating a new provider account

GET

/rest/v1/uc/providers

Getting a list of provider accounts

GET

/rest/v1/uc/providers/<id>

Obtaining provider account information

PATCH

/rest/v1/uc/providers/<id>

Changing provider account information

DELETE

/rest/v1/uc/providers/<id>

Deleting a provider account

LOOKUP

/rest/v1/uc/providers

Searching for a provider account ID


Creating a new provider account

Request

Field Description: provider entity

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

provider entity

Response

Field Description: provider entity

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

{
  "id": "c581b67c-016c-d219-b121-50e54938780c",
  "code": "3528769",
  "enabled": 1,
  "username": "aaa",
  "login": "3528769",
  "pwd": "bbb",
  "domain": "sipnet.ru",
  "proxyaddr": "212.53.40.40",
  "proxyport": 0,
  "transport": "tcp",
  "alternative_proxies": "",
  "extaddrs": "",
  "serveridx": 11,
  "reg": 1,
  "expires": 600,
  "pingmode": "rn",
  "pingsrv": "",
  "pingtimeout": 10,
  "localdomain": "",
  "media": 0,
  "reinvite": 1,
  "translit": 0,
  "lic": {
    "siptrunks": 5
  },
  "trunksout": 3,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-27T08:03:14.84Z",
    "lwt": "2019-08-27T08:03:14.84Z"
  }
}

Getting a list of provider accounts

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, code, enabled, username, login, domain, proxyaddr, proxyport, transport, alternative_proxies, extaddrs, serveridx, reg, expires, pingmode, pingsrv, pingtimeout, localdomain, media, reinvite, translit, lic, trunksout, opts.title, ext.ct, ext.lwt..

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/providers?offset=0&limit=2 HTTP/1.1

Response

Field Description: provider entity

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

[
  {
    "id": "c581b67c-016c-d219-b121-50e54938780c",
    "code": "3528769",
    "enabled": 1,
    "username": "MyAccount",
    "login": "3528769",
    "domain": "sipnet.ru",
    "proxyaddr": "212.53.40.40",
    "proxyport": 5060,
    "transport": "tcp",
    "alternative_proxies": "tcp:212.53.40.41:5060,tcp:212.53.40.42:5060",
    "extaddrs": "sipnet.ru,212.53.40.41,212.53.40.42",
    "serveridx": 11,
    "reg": 1,
    "expires": 600,
    "pingmode": "rn",
    "pingsrv": "",
    "pingtimeout": 10,
    "localdomain": "",
    "media": 0,
    "reinvite": 1,
    "translit": 0,
    "lic": {
      "siptrunks": 5
    },
    "trunksout": 3,
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-27T08:03:14.84Z",
      "lwt": "2019-08-27T08:03:14.84Z"
    }
  },
  {
    "id": "58563833-016c-d21b-070f-50e54938780c",
    "code": "Oktell",
    "enabled": 1,
    "username": "testuser11",
    "login": "testuser11",
    "domain": "test.oktell.ru",
    "proxyaddr": "",
    "proxyport": 5060,
    "transport": "udp",
    "alternative_proxies": "",
    "extaddrs": "",
    "serveridx": 11,
    "reg": 1,
    "expires": 180,
    "pingmode": "none",
    "pingsrv": "",
    "pingtimeout": 10,
    "localdomain": "",
    "media": 1,
    "reinvite": 0,
    "translit": 0,
    "lic": {
      "siptrunks": 1000
    },
    "trunksout": 9999,
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-27T08:04:42.38Z",
      "lwt": "2019-08-27T08:04:42.38Z"
    }
  }
]

Obtaining provider account information

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/providers/c581b67c-016c-d219-b121-50e54938780c HTTP/1.1

Response

Field Description: provider entity

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

{
  "id": "c581b67c-016c-d219-b121-50e54938780c",
  "code": "3528769",
  "enabled": 1,
  "username": "MyAccount",
  "login": "3528769",
  "pwd": "VeryStrongPassword",
  "domain": "sipnet.ru",
  "proxyaddr": "212.53.40.40",
  "proxyport": 5060,
  "transport": "tcp",
  "alternative_proxies": "tcp:212.53.40.41:5060,tcp:212.53.40.42:5060",
  "extaddrs": "sipnet.ru,212.53.40.41,212.53.40.42",
  "serveridx": 11,
  "reg": 1,
  "expires": 600,
  "pingmode": "rn",
  "pingsrv": "",
  "pingtimeout": 10,
  "localdomain": "",
  "media": 0,
  "reinvite": 1,
  "translit": 0,
  "lic": {
    "siptrunks": 5
  },
  "trunksout": 3,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-27T08:03:14.84Z",
    "lwt": "2019-08-27T08:03:14.84Z"
  }
}

Changing provider account information

Fields prohibited for modification: id

Request

Field Description: provider entity

Request example
PATCH /rest/v1/uc/providers/c581b67c-016c-d219-b121-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

provider entity

Response

Field Description: provider entity

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

{
  "id": "c581b67c-016c-d219-b121-50e54938780c",
  "code": "3528769",
  "enabled": 1,
  "username": "MyAccount",
  "login": "3528769",
  "pwd": "VeryStrongPassword",
  "domain": "sipnet.ru",
  "proxyaddr": "212.53.40.40",
  "proxyport": 5060,
  "transport": "tcp",
  "alternative_proxies": "tcp:212.53.40.41:5060,tcp:212.53.40.42:5060",
  "extaddrs": "sipnet.ru,212.53.40.41,212.53.40.42",
  "serveridx": 11,
  "reg": 1,
  "expires": 600,
  "pingmode": "rn",
  "pingsrv": "",
  "pingtimeout": 10,
  "localdomain": "",
  "media": 0,
  "reinvite": 1,
  "translit": 0,
  "lic": {
    "siptrunks": 5
  },
  "trunksout": 3,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-27T08:03:14.84Z",
    "lwt": "2019-08-27T08:03:14.84Z"
  }
}

Deleting a provider account

Request

Request example
DELETE /rest/v1/uc/providers/c581b67c-016c-d219-b121-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Searching for a provider account ID

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

Key fields to search for: id, code

Request

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

"Oktell"

Response

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

[
  "58563833-016c-d21b-070f-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"
}