Subscriber function codes (featurecodes)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/featurecodes

Creation of a new CAF

GET

/rest/v1/uc/featurecodes

Obtaining the list of CAFs

GET

/rest/v1/uc/featurecodes/<id>

Obtaining CAF data

PATCH

/rest/v1/uc/featurecodes/<id>

Changing CAF data

DELETE

/rest/v1/uc/featurecodes/<id>

Removal of CAF

LOOKUP

/rest/v1/uc/featurecodes

Search for CAF identifier


Creation of a new CAF

Request

Field Description: featurecode entity

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

featurecode entity

Response

Field Description: featurecode entity

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

{
  "id": "c0d66244-016c-b869-ead9-50e54938780c",
  "prefix": "150",
  "type": "ivr",
  "extension": "vmail",
  "priority": 100,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-22T08:20:44.88Z",
    "lwt": "2019-08-22T08:20:44.88Z"
  }
}

Obtaining the list of CAFs

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, prefix, type, extension, priority, opts.title, 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/featurecodes?filter={"type":"ivr"}&offset=0&limit=2 HTTP/1.1

Response

Field Description: featurecode entity

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

[
  {
    "id": "c0d66244-016c-b869-ead9-50e54938780c",
    "prefix": "150",
    "type": "ivr",
    "extension": "vmail",
    "priority": 1234,
    "ext": {
      "ct": "2019-08-22T08:20:44.88Z",
      "lwt": "2019-08-22T08:20:44.88Z"
    }
  },
  {
    "id": "c2171b12-016c-b86a-2517-50e54938780c",
    "prefix": "*101",
    "type": "ivr",
    "extension": "welcome",
    "priority": 300,
    "ext": {
      "ct": "2019-08-22T08:20:59.79Z",
      "lwt": "2019-08-22T08:20:59.79Z"
    }
  }
]

Obtaining CAF 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/featurecodes/dccd337a-016c-d1cf-7393-50e54938780c HTTP/1.1

Response

Field Description: featurecode entity

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

{
  "id": "dccd337a-016c-d1cf-7393-50e54938780c",
  "prefix": "*99",
  "type": "voicemail",
  "extension": "",
  "priority": 100,
  "opts": {
    "title": "",
    "comment": "default voicemail receive script used"
  },
  "ext": {
    "ct": "2019-08-27T06:42:09.17Z",
    "lwt": "2019-08-27T06:42:09.17Z"
  }
}

Changing CAF data

Fields prohibited for modification: id

Request

Field Description: featurecode entity

Request example
PATCH /rest/v1/uc/featurecodes/c0d66244-016c-b869-ead9-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

featurecode entity

Response

Field Description: featurecode entity

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

{
  "id": "c0d66244-016c-b869-ead9-50e54938780c",
  "prefix": "*101",
  "type": "ivr",
  "extension": "vmail",
  "priority": 100,
  "opts": {
    "title": "",
    "comment": "custom voicemail IVR script"
  },
  "ext": {
    "ct": "2019-08-22T08:20:44.88Z",
    "lwt": "2019-09-08T11:46:59.02Z"
  }
}

Removal of CAF

Request

Request example
DELETE /rest/v1/uc/featurecodes/c0d66244-016c-b869-ead9-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Search for CAF identifier

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

Key fields to search for: id, prefix

Request

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

"*101"

Response

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

[
  "c0d66244-016c-b869-ead9-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"
}