Waiting queues (hunts)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new waiting list
Request
Field Description: hunt entity
POST /rest/v1/uc/hunts HTTP/1.1
Content-Type: application/json; charset=utf-8
hunt entity
Response
Field Description: hunt entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "a9667bcc-016c-cd71-6d06-50e54938780c",
"code": "hunt_4",
"phonenumber": "402",
"priority": 5,
"type": "sipuser",
"resources": [
{
"id": "65ac9beb-016c-b372-e769-50e54938780c",
"priority": 100
},
{
"id": "0007f945-016c-b373-2772-50e54938780c",
"priority": 99
}
],
"strategy": {
"mode": "timers",
"seconds": [5]
},
"resmode": "priorityrandom",
"objmode": "spqwfq",
"weight": 10,
"wivrscript": "welcome",
"qivrscript": "queue_bob_marley",
"preivrscript": "notify",
"reslimit": 0,
"maxattempts": 10,
"maxattemptstrannumber": "401",
"timeout": 0,
"timeouttrannumber": "401",
"resdialtimeout": 0,
"displayname": "",
"huntblock": {
"enabled": true,
"expires": 30,
"reason": "simple_pause"
},
"resbansec": 20,
"opts": {
"title": "",
"comment": "",
"exit_no_resource": false
},
"ext": {
"ct": "2019-08-26T10:20:58.50Z",
"lwt": "2019-08-26T10:20:58.50Z"
}
}
Getting the list of waiting queues
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, code, phonenumber, priority, type, strategy, resmode, objmode, weight, reslimit, maxattempts, maxattemptstrannumber, resdialtimeout, timeout, timeouttrannumber, displayname, huntblock, resbansec, opts.title, opts.exit_no_resource, 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/hunts?offset=0&limit=2 HTTP/1.1
Response
Field Description: hunt entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "a9667bcc-016c-cd71-6d06-50e54938780c",
"code": "hunt_4",
"phonenumber": "402",
"priority": 5,
"type": "sipuser",
"strategy": {
"mode": "timers",
"seconds": [5]
},
"resmode": "priorityrandom",
"objmode": "spqwfq",
"weight": 10,
"wivrscript": "welcome",
"qivrscript": "queue_bob_marley",
"preivrscript": "notify",
"reslimit": 0,
"maxattempts": 10,
"maxattemptstrannumber": "401",
"timeout": 0,
"timeouttrannumber": "401",
"resdialtimeout": 0,
"displayname": "",
"huntblock": {
"enabled": true,
"expires": 30,
"reason": "simple_pause"
},
"resbansec": 20,
"opts": {
"title": "",
"exit_no_resource": false
},
"ext": {
"ct": "2019-08-26T10:20:58.50Z",
"lwt": "2019-08-26T10:20:58.50Z"
}
},
{
"id": "a9667bcc-016c-cd71-6d06-50e54938780c",
"code": "hunt_5",
"phonenumber": "405",
"priority": 50,
"type": "sipuser",
"strategy": {
"mode": "simple"
},
"resmode": "priorityrandom",
"objmode": "spq",
"weight": 15,
"wivrscript": "welcome",
"qivrscript": "play_long",
"preivrscript": "notify",
"reslimit": 0,
"maxattempts": 10,
"maxattemptstrannumber": "401",
"timeout": 0,
"timeouttrannumber": "401",
"resdialtimeout": 0,
"displayname": "",
"huntblock": {
"enabled": true,
"expires": 30,
"reason": "simple_pause"
},
"resbansec": 20,
"opts": {
"title": "",
"exit_no_resource": false
},
"ext": {
"ct": "2019-08-26T10:20:58.50Z",
"lwt": "2019-08-26T10:20:58.50Z"
}
}
]
Obtaining waiting list data
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/uc/hunts/142e6187-016c-cd70-0da4-50e54938780c HTTP/1.1
Response
Field Description: hunt entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "a9667bcc-016c-cd71-6d06-50e54938780c",
"code": "hunt_4",
"phonenumber": "402",
"priority": 5,
"type": "sipuser",
"resources": [
{
"id": "65ac9beb-016c-b372-e769-50e54938780c",
"priority": 100
},
{
"id": "0007f945-016c-b373-2772-50e54938780c",
"priority": 99
}
],
"strategy": {
"mode": "timers",
"seconds": [ 5 ]
},
"resmode": "priorityrandom",
"objmode": "spqwfq",
"weight": 10,
"wivrscript": "welcome",
"qivrscript": "queue_bob_marley",
"preivrscript": "notify",
"reslimit": 0,
"maxattempts": 10,
"maxattemptstrannumber": "401",
"timeout": 0,
"timeouttrannumber": "401",
"resdialtimeout": 0,
"displayname": "",
"huntblock": {
"enabled": true,
"expires": 30,
"reason": "simple_pause"
},
"resbansec": 20,
"opts": {
"title": "",
"comment": "",
"exit_no_resource": false
},
"ext": {
"ct": "2019-08-26T10:20:58.50Z",
"lwt": "2019-08-26T10:20:58.50Z"
}
}
Changing waiting queue data
Fields prohibited for modification: id
Request
Field Description: hunt entity
PATCH /rest/v1/uc/hunts/142e6187-016c-cd70-0da4-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
hunt entity
Response
Field Description: hunt entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "a9667bcc-016c-cd71-6d06-50e54938780c",
"code": "hunt_4",
"phonenumber": "402",
"priority": 5,
"type": "sipuser",
"resources": [
{
"id": "65ac9beb-016c-b372-e769-50e54938780c",
"priority": 100
},
{
"id": "0007f945-016c-b373-2772-50e54938780c",
"priority": 99
},
{
"id": "66297232-9f5b-371a-2202-394fa940f3882",
"priority": 95
}
],
"strategy": {
"mode": "timers",
"seconds": [5, 10]
},
"resmode": "priorityrandom",
"objmode": "spqwfq",
"weight": 10,
"wivrscript": "welcome",
"qivrscript": "queue_bob_marley",
"preivrscript": "notify",
"reslimit": 0,
"maxattempts": 10,
"maxattemptstrannumber": "401",
"timeout": 0,
"timeouttrannumber": "401",
"resdialtimeout": 0,
"displayname": "",
"huntblock": {
"enabled": true,
"expires": 30,
"reason": "simple_pause"
},
"resbansec": 20,
"opts": {
"title": "",
"comment": "",
"exit_no_resource": false
},
"ext": {
"ct": "2019-08-26T10:20:58.50Z",
"lwt": "2019-09-09T17:46:31.25Z"
}
}
Searching for a waiting queue identifier
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id, code, phonenumber
Request
LOOKUP /rest/v1/uc/hunts HTTP/1.1
Content-Type: application/json; charset=utf-8
"hunt_4"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"142e6187-016c-cd70-0da4-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}