IVR scripts (ivrscripts)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/ivrscripts

Creating a new IVR script

GET

/rest/v1/uc/ivrscripts

Getting the list of IVR scripts

GET

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

Getting data of IVR script

PATCH

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

Modifying data of IVR script

DELETE

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

Deleting IVR script

LOOKUP

/rest/v1/uc/ivrscripts

Searching for the identifier of IVR script


Creating a new IVR script

Request

Field description: IVR script’s entity

Example request
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

Example response
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": "Answer",

        "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 IVR scripts

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 output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/uc/ivrscripts?offset=0&limit=2 HTTP/1.1

Response

Field description: IVR script’s entity

Example response
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"
    }
  }
]

Getting data of IVR script

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

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

Response

Field description: IVR script’s entity

Example response
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": "Answer",

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

Modifying data of IVR script

Fields prohibited for modification: id

Request

Field description: IVR script’s entity

Example request
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

Example response
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": "Answer",

        "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": "Hang up",
        "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 IVR script

Request

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

Response

Example response
HTTP/1.1 204 No Content

Searching for the identifier of IVR script

Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.

Key fields for search: id, code

Request

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

"play_test"

Response

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

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

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