Routing vectors (routes)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/routes

Creating a new routing vector

GET

/rest/v1/uc/routes

Getting the list of routing vectors

GET

/rest/v1/uc/routes/<id>

Getting data of routing vector

PATCH

/rest/v1/uc/routes/<id>

Modifying data of routing vector

DELETE

/rest/v1/uc/routes/<id>

Deleting routing vector

LOOKUP

/rest/v1/uc/routes

Searching for the identifier of routing vector


Creating a new routing vector

Request

Field description: route entity

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

route entity

Response

Field description: route entity

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

{
  "id": "b00035ca-016c-ccde-b60c-50e54938780c",
  "vector": "default",
  "priority": 99,
  "dir": "outer",
  "fromdomain": "",
  "fromnumber": "",
  "fromextaccount": "",
  "tonumber": "[]9XXX",
  "schedule": "all",
  "periods": [],
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2019-08-26T07:40:43.15Z",
    "lwt": "2019-08-26T07:40:43.15Z"
  }
}

Getting the list of routing vectors

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, vector, priority, dir, fromnumber, fromextaccount, fromdomain, tonumber, schedule, 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/routes?offset=0&limit=2 HTTP/1.1

Response

Field description: route entity

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

[
  {
    "id": "5b8ef76d-016c-b377-6c01-50e54938780c",
    "vector": "externals",
    "priority": 5,
    "dir": "",
    "fromdomain": "4XX",
    "fromnumber": "",
    "fromextaccount": "",
    "tonumber": "9XXXXXXXXXX",
    "schedule": "all",
    "ext": {
      "ct": "2019-08-21T09:17:23.84Z",
      "lwt": "2019-08-21T09:17:23.84Z"
    }
  },
  {
    "id": "b00035ca-016c-ccde-b60c-50e54938780c",
    "vector": "default",
    "priority": 99,
    "dir": "outer",
    "fromdomain": "",
    "fromnumber": "",
    "fromextaccount": "",
    "tonumber": "[*]9XXX",
    "schedule": "all",
    "ext": {
      "ct": "2019-08-26T07:40:43.15Z",
      "lwt": "2019-08-26T07:40:43.15Z"
    }
  }
]

Getting data of routing vector

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/routes/b00035ca-016c-ccde-b60c-50e54938780c HTTP/1.1

Response

Field description: route entity

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

{
  "id": "b00035ca-016c-ccde-b60c-50e54938780c",
  "vector": "default",
  "priority": 99,
  "dir": "outer",
  "fromdomain": "",
  "fromnumber": "",
  "fromextaccount": "",
  "tonumber": "[]9XXX",
  "schedule": "all",
  "periods": [],
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2019-08-26T07:40:43.15Z",
    "lwt": "2019-08-26T07:40:43.15Z"
  }
}

Modifying data of routing vector

Fields prohibited for modification: id

Request

Field description: route entity

Example request
PATCH /rest/v1/uc/routes/b00035ca-016c-ccde-b60c-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

route entity

Response

Field description: route entity

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

{
  "id": "b00035ca-016c-ccde-b60c-50e54938780c",
  "vector": "default",
  "priority": 99,
  "dir": "outer",
  "fromdomain": "",
  "fromnumber": "",
  "fromextaccount": "r1",
  "tonumber": "*",
  "schedule": "custom",
  "periods": [
    {
      "daystart": 1,
      "timestart": 480,
      "daystop": 1,
      "timestop": 1080
    },
    {
      "daystart": 2,
      "timestart": 480,
      "daystop": 5,
      "timestop": 1080
    }
  ],
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2019-08-26T07:40:43.15Z",
    "lwt": "2019-09-07T17:22:21.57Z"
  }
}

Deleting routing vector

Request

Example request
DELETE /rest/v1/uc/routes/b00035ca-016c-ccde-b60c-50e54938780c HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for the identifier of routing vector

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

Key fields for search: id

Request

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

"b00035ca-016c-ccde-b60c-50e54938780c"

Response

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

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

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