Forwarding rules (redirectrules)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new forwarding rule
Request
Field Description: redirectrule entity
POST /rest/v1/uc/redirectrules HTTP/1.1
Content-Type: application/json; charset=utf-8
redirectrule entity
Response
Field Description: redirectrule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "df684c6d-016c-d25c-23f0-50e54938780c",
"type": "busy",
"filter_number": "16",
"filter_fromnumber": "*",
"tran_number": "15",
"priority": 100,
"enabled": 1,
"schedule": "all",
"periods": [],
"opts": {
"comment": "",
"title": ""
},
"ext": {
"ct": "2019-08-27T09:15:49.61Z",
"lwt": "2019-08-27T09:15:49.61Z"
}
}
Getting the list of forwarding rules
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, type, filter_number, tran_number, priority, enabled, schedule, 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/redirectrules?filter={"schedule":"non-work","enabled":1}&offset=0&limit=2 HTTP/1.1
Response
Field Description: redirectrule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "90082f72-016c-d268-a209-50e54938780c",
"type": "busy",
"filter_number": "2XX",
"filter_fromnumber": "",
"tran_number": "205",
"priority": 55,
"enabled": 1,
"schedule": "non-work",
"opts": {
"title": ""
},
"ext": {
"ct": "2019-08-27T09:29:28.32Z",
"lwt": "2019-08-27T09:29:28.32Z"
}
},
{
"id": "c4e35f4b-016c-d267-ebfa-50e54938780c",
"type": "absolute",
"filter_number": "2XX",
"filter_fromnumber": "",
"tran_number": "203",
"priority": 99,
"enabled": 1,
"schedule": "non-work",
"opts": {
"title": ""
},
"ext": {
"ct": "2019-08-27T09:28:41.72Z",
"lwt": "2019-08-27T09:28:41.72Z"
}
}
]
Obtaining forwarding rule data
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/uc/redirectrules/df684c6d-016c-d25c-23f0-50e54938780c HTTP/1.1
Response
Field Description: redirectrule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "df684c6d-016c-d25c-23f0-50e54938780c",
"type": "busy",
"filter_number": "16",
"filter_fromnumber": "*",
"tran_number": "15",
"priority": 100,
"enabled": 1,
"schedule": "all",
"periods": [],
"opts": {
"comment": "",
"title": ""
},
"ext": {
"ct": "2019-08-27T09:15:49.61Z",
"lwt": "2019-08-27T09:15:49.61Z"
}
}
Changing forwarding rule data
Fields prohibited for modification: id
Request
Field Description: redirectrule entity
PATCH /rest/v1/uc/redirectrules/df684c6d-016c-d25c-23f0-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
redirectrule entity
Response
Field Description: redirectrule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "df684c6d-016c-d25c-23f0-50e54938780c",
"type": "absolute",
"filter_number": "16",
"filter_fromnumber": "*",
"tran_number": "15",
"priority": 100,
"enabled": 1,
"schedule": "custom",
"periods": [
{
"daystart": 6,
"timestart": 1080,
"daystop": 7,
"timestart": 1440
},
{
"daystart": 1,
"timestart": 0,
"daystop": 1,
"timestart": 480
}
],
"opts": {
"comment": "",
"title": ""
},
"ext": {
"ct": "2019-08-27T09:15:49.61Z",
"lwt": "2019-09-09T08:47:39.22Z"
}
}
Deleting a forwarding rule
Searching for the forwarding rule identifier
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id, filter_number
Request
LOOKUP /rest/v1/uc/redirectrules HTTP/1.1
Content-Type: application/json; charset=utf-8
"16"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"df684c6d-016c-d25c-23f0-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}