Scenarios IVR (ivrscripts)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/ivrscripts

Creating a new scenario IVR

GET

/rest/v1/uc/ivrscripts

Getting the list of scenarios IVR

GET

/rest/v1/uc/ivrscripts/<id>

Obtaining scenario data IVR

PATCH

/rest/v1/uc/ivrscripts/<id>

Changing scenario data IVR

DELETE

/rest/v1/uc/ivrscripts/<id>

Deleting a scenario IVR

LOOKUP

/rest/v1/uc/ivrscripts

Searching for a scenario identifier IVR


Creating a new scenario IVR

Request

Field Description: IVR script’s entity

Request example
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

Response example
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

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, code, name, projectid, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/uc/ivrscripts?offset=0&limit=2 HTTP/1.1

Response

Field Description: IVR script’s entity

Response example
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

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/uc/ivrscripts/88e149e4-016c-b477-0c3d-50e54938780c HTTP/1.1

Response

Field Description: IVR script’s entity

Response example
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

Request example
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

Response example
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"
  }
}

Deleting a scenario IVR

Request

Request example
DELETE /rest/v1/uc/ivrscripts/95e55d64-016c-b845-7a80-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

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

Request example
LOOKUP /rest/v1/uc/ivrscripts HTTP/1.1
Content-Type: application/json; charset=utf-8

"play_test"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "88e149e4-016c-b477-0c3d-50e54938780c"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}