Subscriber feature codes (featurecodes)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/featurecodes

Creating a new feature code

GET

/rest/v1/uc/featurecodes

Getting the list of feature codes

GET

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

Getting feature code data

PATCH

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

Modifying feature code data

DELETE

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

Deleting a feature code

LOOKUP

/rest/v1/uc/featurecodes

Searching for a feature code identifier


Creating a new feature code

Request

Field description: featurecode entity

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

featurecode entity

Response

Field description: featurecode entity

Example response
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"
  }
}

Getting the list of feature codes

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 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/featurecodes?filter={"type":"ivr"}&offset=0&limit=2 HTTP/1.1

Response

Field description: featurecode entity

Example response
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"
    }
  }
]

Getting feature code 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/featurecodes/dccd337a-016c-d1cf-7393-50e54938780c HTTP/1.1

Response

Field description: featurecode entity

Example response
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"
  }
}

Modifying feature code data

Fields prohibited for modification: id

Request

Field description: featurecode entity

Example request
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

Example response
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"
  }
}

Deleting a feature code

Request

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

Response

Example response
HTTP/1.1 204 No Content

Searching for a feature code identifier

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

Key fields for search: id, prefix

Request

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

"*101"

Response

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

[
  "c0d66244-016c-b869-ead9-50e54938780c"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

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