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>

Obtaining routing vector data

PATCH

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

Changing routing vector data

DELETE

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

Deleting a routing vector

LOOKUP

/rest/v1/uc/routes

Searching for a routing vector identifier


Creating a new routing vector

Request

Field Description: route entity

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

route entity

Response

Field Description: route entity

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

Response

Field Description: route entity

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

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

Response

Field Description: route entity

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

Changing routing vector data

Fields prohibited for modification: id

Request

Field Description: route entity

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

Response example
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 a routing vector

Request

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

Response

Response example
HTTP/1.1 204 No Content

Searching for a routing vector identifier

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

Key fields to search for: id

Request

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

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

Response

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

[
  "b00035ca-016c-ccde-b60c-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"
}