Сценарии IVR (ivrscripts)
Запросы
HTTP verb | Endpoint | Описание |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Создание нового сценария IVR
Запрос
Описание полей: IVR script’s entity
POST /rest/v1/uc/ivrscripts HTTP/1.1
Content-Type: application/json; charset=utf-8
IVR script’s entity
Ответ
Описание полей: IVR script’s entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "88e149e4-016c-b477-0c3d-50e54938780c",
"code": "play_test",
"name": "PlayOut",
"scriptdata": {
"objects": [
{
"oId": 1,
"oLeft": 32,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:22:51",
"oLayer": 0,
"oType": 101,
"type": 0,
"defineVars": 1,
"implementedTime": 60000,
"transfer": 2,
"name": "Старт",
"info": ""
},
{
"oId": 2,
"oLeft": 116,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:23:00",
"oLayer": 0,
"oType": 202,
"transfer": 3,
"name": "Ответ",
"info": ""
},
{
"oId": 3,
"oLeft": 208,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-21 16:57:16",
"oLayer": 0,
"oType": 103,
"timeoutMs": {
"argType": 1,
"varType": 2,
"value": "700"
},
"transfer": 4,
"name": "Пауза",
"info": ""
},
{
"oId": 4,
"oLeft": 288,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-21 16:57:20",
"oLayer": 0,
"oType": 204,
"playerId": "default",
"mode": 0,
"randomize": 1,
"file": {
"selectMode": 0,
"localFile": "oktell_1_ny.wav"
},
"loop": 0,
"clearDtmfBuffer": 1,
"interruptSymbols": "*",
"clearInterrupt": 1,
"name": "Воспроизведение",
"info": ""
}
],
"variables": [
{
"id": "6745e9fc-cd6c-40ab-92f2-bcf78a220b0c",
"name": "var1",
"type": 1,
"location": 0
},
{
"id": "ce834e56-be72-4069-9eec-fc7df61c4a75",
"name": "result",
"type": 2,
"location": 0
}
],
"scriptVersion": 170105
},
"projectid": "00000000-0000-0000-0000-000000000000",
"lwt": "2019-08-21T13:59:39Z",
"opts": {
"title": "",
"comment": "Hello world ivrscript",
"loglevel": 0,
"variables": {
"var1": 0
}
},
"ext": {
"ct": "2019-08-21T13:59:39.83Z",
"lwt": "2019-08-21T13:59:39.83Z"
}
}
Получение списка сценариев IVR
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Фильтр по значениям полей. |
|
|
Список полей для вывода. Доступные поля для выдачи: id, code, name, projectid, ext.lwt, ext.ct. |
|
|
Смещение в списке ресурсов, подлежащих выдаче. |
|
|
Максимальное количество ресурсов в списке. |
|
|
Порядок сортировки ресурсов в списке. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/uc/ivrscripts?offset=0&limit=2 HTTP/1.1
Ответ
Описание полей: IVR script’s entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "88e149e4-016c-b477-0c3d-50e54938780c",
"code": "play_test",
"name": "PlayOut",
"projectid": "00000000-0000-0000-0000-000000000000",
"ext": {
"ct": "2019-08-21T13:59:39.83Z",
"lwt": "2019-08-21T13:59:39.83Z"
}
},
{
"id": "95e55d64-016c-b845-7a80-50e54938780c",
"code": "1002",
"name": "PlayNumbers",
"projectid": "00000000-0000-0000-0000-000000000000",
"ext": {
"ct": "2019-08-22T07:40:56.83Z",
"lwt": "2019-08-22T07:40:56.83Z"
}
}
]
Получение данных сценария IVR
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Список полей для вывода. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/uc/ivrscripts/88e149e4-016c-b477-0c3d-50e54938780c HTTP/1.1
Ответ
Описание полей: IVR script’s entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "88e149e4-016c-b477-0c3d-50e54938780c",
"code": "play_test",
"name": "PlayOut",
"scriptdata": {
"objects": [
{
"oId": 1,
"oLeft": 32,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:22:51",
"oLayer": 0,
"oType": 101,
"type": 0,
"defineVars": 1,
"implementedTime": 60000,
"transfer": 2,
"name": "Старт",
"info": ""
},
{
"oId": 2,
"oLeft": 116,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:23:00",
"oLayer": 0,
"oType": 202,
"transfer": 3,
"name": "Ответ",
"info": ""
},
{
"oId": 3,
"oLeft": 208,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-21 16:57:16",
"oLayer": 0,
"oType": 103,
"timeoutMs": {
"argType": 1,
"varType": 2,
"value": "700"
},
"transfer": 4,
"name": "Пауза",
"info": ""
},
{
"oId": 4,
"oLeft": 288,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-21 16:57:20",
"oLayer": 0,
"oType": 204,
"playerId": "default",
"mode": 0,
"randomize": 1,
"file": {
"selectMode": 0,
"localFile": "oktell_1_ny.wav"
},
"loop": 0,
"clearDtmfBuffer": 1,
"interruptSymbols": "*",
"clearInterrupt": 1,
"name": "Воспроизведение",
"info": ""
}
],
"variables": [],
"scriptVersion": 170105
},
"projectid": "00000000-0000-0000-0000-000000000000",
"lwt": "2019-08-21T13:59:39Z",
"opts": {
"title": "",
"comment": "Hello world ivrscript",
"loglevel": 0,
"variables": {
"var1": 0
}
},
"ext": {
"ct": "2019-08-21T13:59:39.83Z",
"lwt": "2019-08-21T13:59:39.83Z"
}
}
Изменение данных сценария IVR
Поля запрещенные для изменения: id
Запрос
Описание полей: IVR script’s entity
PATCH /rest/v1/uc/ivrscripts/95e55d64-016c-b845-7a80-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
IVR script’s entity
Ответ
Описание полей: IVR script’s entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "88e149e4-016c-b477-0c3d-50e54938780c",
"code": "play_test",
"name": "PlayOut",
"scriptdata": {
"objects": [
{
"oId": 1,
"oLeft": 32,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:22:51",
"oLayer": 0,
"oType": 101,
"type": 0,
"defineVars": 1,
"implementedTime": 60000,
"transfer": 2,
"name": "Старт",
"info": ""
},
{
"oId": 2,
"oLeft": 116,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:23:00",
"oLayer": 0,
"oType": 202,
"transfer": 3,
"name": "Ответ",
"info": ""
},
{
"oId": 3,
"oLeft": 208,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-21 16:57:16",
"oLayer": 0,
"oType": 103,
"timeoutMs": {
"argType": 1,
"varType": 2,
"value": "700"
},
"transfer": 4,
"name": "Пауза",
"info": ""
},
{
"oId": 4,
"oLeft": 288,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-21 16:57:20",
"oLayer": 0,
"oType": 204,
"playerId": "default",
"mode": 0,
"randomize": 1,
"file": {
"selectMode": 0,
"localFile": "oktell_1_ny.wav"
},
"loop": 0,
"clearDtmfBuffer": 1,
"interruptSymbols": "*",
"clearInterrupt": 1,
"transfer": 5,
"name": "Воспроизведение",
"info": ""
},
{
"oId": 5,
"oLeft": 304,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 10:41:28",
"oLayer": 0,
"oType": 201,
"name": "Отбой",
"info": ""
}
],
"variables": [
{
"id": "6745e9fc-cd6c-40ab-92f2-bcf78a220b0c",
"name": "var1",
"type": 1,
"location": 0
},
{
"id": "8c35152b-62b4-4986-b139-f76f0f0de878",
"name": "asdf",
"type": 2,
"location": 0
},
{
"id": "478731bc-7de1-435b-a51b-2dc2dc050697",
"name": "path",
"type": 2,
"location": 0
},
{
"id": "ce834e56-be72-4069-9eec-fc7df61c4a75",
"name": "result",
"type": 2,
"location": 0
}
],
"scriptVersion": 170105
},
"projectid": "00000000-0000-0000-0000-000000000000",
"lwt": "2019-09-09T12:21:04Z",
"opts": {
"title": "",
"comment": "Hello world ivrscript",
"loglevel": 0,
"variables": {
"var1": 123,
"asdf": "Default value from opts"
}
},
"ext": {
"ct": "2019-08-21T13:59:39.83Z",
"lwt": "2019-09-09T12:21:04.51Z"
}
}