Scenarios IVR (ivrscripts)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new scenario IVR
Request
Field Description: IVR script’s entity
POST /rest/v1/uc/ivrscripts HTTP/1.1
Content-Type: application/json; charset=utf-8
IVR script’s entity
Response
Field Description: 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": "Start",
"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": "Response",
"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": "Pause",
"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": "Playback",
"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"
}
}
Getting the list of scenarios IVR
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, code, name, projectid, 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/ivrscripts?offset=0&limit=2 HTTP/1.1
Response
Field Description: 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"
}
}
]
Obtaining scenario data IVR
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/uc/ivrscripts/88e149e4-016c-b477-0c3d-50e54938780c HTTP/1.1
Response
Field Description: 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": "Start",
"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": "Response",
"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": "Pause",
"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": "Playback",
"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"
}
}
Changing scenario data IVR
Fields prohibited for modification: id
Request
Field Description: 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
Response
Field Description: 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": "Start",
"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": "Response",
"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": "Pause",
"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": "Playback",
"info": ""
},
{
"oId": 5,
"oLeft": 304,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 10:41:28",
"oLayer": 0,
"oType": 201,
"name": "Stand down",
"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"
}
}
Searching for a scenario identifier IVR
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id, code
Request
LOOKUP /rest/v1/uc/ivrscripts HTTP/1.1
Content-Type: application/json; charset=utf-8
"play_test"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"88e149e4-016c-b477-0c3d-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}