Routing rules (vectorrules)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new routing rule
Request
Field Description: vectrorule entity
POST /rest/v1/uc/vectorrules HTTP/1.1
Content-Type: application/json; charset=utf-8
vectrorule entity
Response
Field Description: vectrorule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ca54ed9e-016c-b377-cb5a-50e54938780c",
"vector": "default",
"priority": 100,
"action": "internal",
"dir": "inner",
"fromdomain": "",
"fromextaccount": "",
"fromnumber": "",
"tonumber": "",
"toextaccount": "",
"todomain": "",
"routecode": "",
"modfromnumber": "T",
"modtonumber": "T",
"modroutecode": "",
"schedule": "work",
"periods": [],
"opts": {
"comment": "",
"title": ""
},
"ext": {
"ct": "2019-08-21T09:17:48.25Z",
"lwt": "2019-08-21T09:17:48.25Z"
}
}
Getting a list of routing rules
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, vector, priority, action, dir, fromnumber, fromdomain, fromextaccount, tonumber, todomain, toextaccount, modfromnumber, modtonumber, opts.title, ext.lwt, ext.ct. |
|
|
Offset in the list of resources to be issued. |
|
|
The maximum number of resources in the list. |
|
|
The sort order of the resources in the list. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/uc/vectorrules?offset=0&limit=2 HTTP/1.1
Response
Field Description: vectrorule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "ca54ed9e-016c-b377-cb5a-50e54938780c",
"vector": "default",
"priority": 100,
"action": "internal",
"dir": "inner",
"fromdomain": "",
"fromextaccount": "",
"fromnumber": "",
"tonumber": "",
"toextaccount": "",
"todomain": "",
"routecode": "",
"modfromnumber": "T",
"modtonumber": "T",
"modroutecode": "",
"schedule": "work",
"opts": {
"title": ""
},
"ext": {
"ct": "2019-08-21T09:17:48.25Z",
"lwt": "2019-08-21T09:17:48.25Z"
}
},
{
"id": "e8d844ab-016c-beb3-f4ec-50e54938780c",
"vector": "default",
"priority": 555,
"action": "crossdomain",
"dir": "cross",
"fromnumber": "",
"fromdomain": "test.rootdomain.ru",
"fromextaccount": "",
"tonumber": "",
"todomain": "",
"toextaccount": "",
"routecode": "",
"modfromnumber": "T",
"modtonumber": "T",
"modroutecode": "*",
"schedule": "all",
"opts": {
"title": ""
},
"ext": {
"ct": "2019-08-23T13:39:20.42Z",
"lwt": "2019-08-23T13:39:20.42Z"
}
}
]
Obtaining routing rule data
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/uc/vectorrules/ca54ed9e-016c-b377-cb5a-50e54938780c HTTP/1.1
Response
Field Description: vectrorule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ca54ed9e-016c-b377-cb5a-50e54938780c",
"vector": "default",
"priority": 100,
"action": "internal",
"dir": "inner",
"fromdomain": "",
"fromextaccount": "",
"fromnumber": "",
"tonumber": "",
"toextaccount": "",
"todomain": "",
"routecode": "",
"modfromnumber": "T",
"modtonumber": "T",
"modroutecode": "",
"schedule": "work",
"periods": [],
"opts": {
"comment": "",
"title": ""
},
"ext": {
"ct": "2019-08-21T09:17:48.25Z",
"lwt": "2019-08-21T09:17:48.25Z"
}
}
Changing routing rule data
Fields prohibited for modification: id
Request
Field Description: vectrorule entity
PATCH /rest/v1/uc/vectorrules/ca54ed9e-016c-b377-cb5a-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
vectrorule entity
Response
Field Description: vectrorule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "ca54ed9e-016c-b377-cb5a-50e54938780c",
"vector": "default",
"priority": 100,
"action": "cross",
"dir": "",
"fromdomain": "",
"fromextaccount": "",
"fromnumber": "XXX",
"tonumber": "XXX",
"toextaccount": "",
"todomain": "test.rootdomain.ru",
"routecode": "",
"modfromnumber": "14T",
"modtonumber": "/X/XXX",
"modroutecode": "*",
"schedule": "work",
"periods": [],
"opts": {
"comment": "",
"title": ""
},
"ext": {
"ct": "2019-08-21T09:17:48.25Z",
"lwt": "2019-08-21T09:17:48.25Z"
}
}
Deleting a routing rule
Searching for a routing rule identifier
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id
Request
LOOKUP /rest/v1/uc/vectorrules HTTP/1.1
Content-Type: application/json; charset=utf-8
"b6edc9b1-016c-b372-63a5-50e54938780c"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"b6edc9b1-016c-b372-63a5-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}