Очереди ожидания (hunts)
Запросы
HTTP verb | Endpoint | Описание |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Создание новой очереди ожидания
Запрос
Описание полей: hunt entity
POST /rest/v1/uc/hunts HTTP/1.1
Content-Type: application/json; charset=utf-8
hunt entity
Ответ
Описание полей: 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"
}
}
Получение списка очередей ожидания
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Фильтр по значениям полей. |
|
|
Список полей для вывода. Доступные поля для выдачи: 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. |
|
|
Смещение в списке ресурсов, подлежащих выдаче. |
|
|
Максимальное количество ресурсов в списке. |
|
|
Порядок сортировки ресурсов в списке. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/uc/hunts?offset=0&limit=2 HTTP/1.1
Ответ
Описание полей: 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"
}
}
]
Получение данных очереди ожидания
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Список полей для вывода. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/uc/hunts/142e6187-016c-cd70-0da4-50e54938780c HTTP/1.1
Ответ
Описание полей: 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"
}
}
Изменение данных очереди ожидания
Поля запрещенные для изменения: id
Запрос
Описание полей: hunt entity
PATCH /rest/v1/uc/hunts/142e6187-016c-cd70-0da4-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
hunt entity
Ответ
Описание полей: 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"
}
}