Voice mail script sound files (voicemail)
Overview
Provides access to files used during playback in system IVR voicemail scripts.
The composition of the files used is fixed and limited, initially the files fall into a directory from assets. The composition depends on the contents of the voicemail and voicemail_send system scripts (asset), which can be changed when building the product.
The directory is located in the category of automatically synchronized directories :SYNC.
Domain-created scripts for voicemail management use their own files and may not access this repository.
The catalog is accessed from scripts using the catalog category prefix ":SYNC_COMMON/voicemail".
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Pouring a group of files
Uploading to the collection is done by Content-Type: multipart/formdata
.
There can be one or more files in the request.
The files are placed under the names specified in the Content-Disposition
headers of each part.
If a file with the specified name already exists, it is not saved and returns an error. Depending on the Content-Type and the presence of successfully placed files, the request may return a failed HTTP response, or failure information in the body of the HTTP response 200 OK.
Request
POST /rest/v1/fs/targets/voicemail HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e
-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="filename"; filename="01.mp3"
Content-Transfer-Encoding: binary
BINARY BODY OF '01.mp3'
-----------boundary_69df8120352a996e--
Getting a list of files
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: name, size, last_modified. |
|
|
Offset in the list of files to be issued. |
|
|
Maximum number of files in the list. |
|
|
The sort order of the files in the list. |
GET /rest/v1/fs/targets/voicemail HTTP/1.1
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"name": "01.mp3",
"size": 70985,
"last_modified": "2019-09-20 10:50:14"
},
{
"name": "ding.wav",
"size": 14758,
"last_modified": "2018-04-28 12:10:21"
},
{
"name": "hold_music.wav",
"size": 1596292,
"last_modified": "2019-09-20 10:50:14"
}
]
File download
Request
Name | Type | Description |
---|---|---|
|
|
Issuance Type. Default
|
GET /rest/v1/fs/targets/voicemail/01.mp3?attachment=true HTTP/1.1
Reloading an existing file
Performs a file replacement.
A single file is uploaded either with Content-Type: multipart/formdata
,
or with an arbitrary Content-Type
that is not multipart.
If the download is done with Content-Type: multipart/formdata
,
then only the first file will be saved (the first part with the filename field in the header)
Content-Disposition
), and the file name itself will be ignored.
Request
PUT /rest/v1/fs/targets/voicemail/01.mp3 HTTP/1.1
Content-Type: application/octet-stream
BINARY BODY OF '01.mp3'
PUT /rest/v1/fs/targets/voicemail/01.mp3 HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e
-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="01.mp3"; filename="01.mp3"
Content-Transfer-Encoding: binary
BINARY BODY OF '01.mp3'
-----------boundary_69df8120352a996e--
Getting meta-information about a file
Returns meta-information about the file, including the size in the header Content-Length
.
Features
-
HTTP-the response does not contain a body, despite the presence of a header
Content-Length
.
Request
Name | Type | Description |
---|---|---|
|
|
Issuance Type. Default
|
HEAD /rest/v1/fs/targets/voicemail/01.mp3?attachment=true HTTP/1.1
See also
-
Assets: sound files
-
Assets: default scripts