Alert sound recordings (alertcall)

Overview

Provides access to files in the shared alert sound recordings directory of the domain. The files contained in the directory can be specified in any alert entity and used by the alert IVR script.

The directory is located in the category of automatically synchronized directories :SYNC.

Access to the directory from scripts is via the directory category prefix ":SYNC_DOMAIN_DATA/alertcall".

Available only in working domains. The alert service (alertcall) does not use this directory. The section is not published in the section descriptions, but routes and access to it are preserved.

Requests

HTTP verb Endpoint Description

POST

/rest/v1/fs/targets/alertcall

Uploading a group of files

GET

/rest/v1/fs/targets/alertcall

Getting the list of files

GET

/rest/v1/fs/targets/alertcall/<filename>

Downloading a file

PUT

/rest/v1/fs/targets/alertcall/<filename>

Re-uploading an existing file

DELETE

/rest/v1/fs/targets/alertcall/<filename>

Deleting a file

HEAD

/rest/v1/fs/targets/alertcall/<filename>

Getting file metadata

METADATA

/rest/v1/fs/targets/alertcall/<filename>

Getting file metadata (METADATA)

PUT

/rest/v1/fs/targets/alertcall/<filename>

Move and rename a file

METADATA

/rest/v1/fs/targets/alertcall

Section root operations

CLEAR

/rest/v1/fs/targets/alertcall

Section root operations


Uploading a group of files

Upload to the collection is performed with Content-Type: multipart/formdata.

The request may contain one or several files. 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 an error is returned. Depending on the Content-Type and the presence of successfully placed files, either a failed HTTP response or failure information in the body of a 200 OK HTTP response may be returned.

Request

Example request
POST /rest/v1/fs/targets/alertcall 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="alert_sound12.mp3"
Content-Transfer-Encoding: binary

BINARY BODY OF 'alert_sound12.mp3'
-----------boundary_69df8120352a996e--

Response

Example response
[
  {
    "name": "alert_sound12.mp3",
    "size": 160042,
    "status": "ok"
  }
]

Getting the list of files

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: name, size, last_modified.

offset

int

Offset in the list of files to output.

limit

int

Maximum number of files in the list.

order

array<object|str>

Sorting order of files in the list.

countonly

bool

When true, only the number of files is returned.

It is counted after applying the filter: with the filter parameter, the number of files matching the filter is returned, not the total number of files in the directory.

Example request
GET /rest/v1/fs/targets/alertcall HTTP/1.1

Response

The time in the last_modified field is returned in UTC.

Example response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "name": "alert_sound11.wav",
    "size": 621692,
    "last_modified": "2019-09-19 12:53:11"
  },
  {
    "name": "alert_sound12.wav",
    "size": 160042,
    "last_modified": "2019-09-19 12:53:11"
  }
]

Downloading a file

Request

Table 2. Request parameters
Name Type Description

attachment

bool

Output type. Default false.

true – returned with the header Content-Disposition: attachment; filename=filename.ext or Content-Disposition: attachment; filename*=UTF-8''%d1%84%d0%b0%d0%b9%d0%bb.ext, where file.ext is the file name in UTF-8 encoding and URL-encoded.

false – returned without the Content-Disposition header.

Example request
GET /rest/v1/fs/targets/alertcall/alert_sound12.mp3?attachment=true HTTP/1.1

Response

Example response
HTTP/1.1 200 OK
Content-Type: application/octet-stream; charset=utf-8
Content-Disposition: attachment; filename*=UTF-8''alert%20sound%2012.mp3

BINARY BODY OF 'alert sound 12.mp3'

Re-uploading an existing file

Replaces the file.

A single file is uploaded either with Content-Type: multipart/formdata or with an arbitrary non-multipart Content-Type.

If the upload uses Content-Type: multipart/formdata, only the first file is saved (the first part having a filename field in the Content-Disposition header), and the file name itself is ignored.

The file name is always taken from the URL.

A request with Content-Type: application/octet-stream and zero body length creates an empty file. A request without a body, without Content-Type, and without the X-Era-Source header is rejected with code 400: the intent cannot be determined from such a request.

The PUT method has another meaning with a different request form: Move and rename a file.

Request

Example request (octet-stream)
PUT /rest/v1/fs/targets/alertcall/alert_sound12.mp3 HTTP/1.1
Content-Type: application/octet-stream

BINARY BODY OF 'alert_sound12.mp3'
Example request (multipart)
PUT /rest/v1/fs/targets/alertcall/alert_sound12.mp3 HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e

-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="alert_sound12.mp3"; filename="alert_sound12.mp3"
Content-Transfer-Encoding: binary

BINARY BODY OF 'alert_sound12.mp3'
-----------boundary_69df8120352a996e--

Response

Example response
HTTP/1.1 204 No Content

Deleting a file

Request

Example request
DELETE /rest/v1/fs/targets/alertcall/alert_sound12.mp3 HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Getting file metadata

Returns file metadata, including the size in the Content-Length header.

Specifics

  • The HTTP response contains no body despite the presence of the Content-Length header.

Request

Table 3. Request parameters
Name Type Description

attachment

bool

Output type. Default false.

true – returned with the header Content-Disposition: attachment; filename=filename.ext or Content-Disposition: attachment; filename*=UTF-8''%d1%84%d0%b0%d0%b9%d0%bb.ext, where file.ext is the file name in UTF-8 encoding and URL-encoded.

false – returned without the Content-Disposition header.

Example request
HEAD /rest/v1/fs/targets/alertcall/alert_sound12.mp3?attachment=true HTTP/1.1

Response

Example successful response
HTTP/1.1 200 OK
Content-Type: audio/x-wav
Last-Modified: Thu, 19 Sep 2019 12:53:11 GMT
Content-Disposition: attachment; filename=alert_sound12.mp3
Content-Length: 160042
Example failed response
HTTP/1.1 404 Not Found

Getting file metadata (METADATA)

Returns the file size and modification time in JSON format. Unlike the HEAD method, the information comes in the response body and does not require parsing headers.

The method is non-standard and is accepted in two equivalent forms: by the method itself (METADATA /rest/v1/fs/targets/alertcall/alert_sound12.mp3) and by POST on a path with the suffix (POST /rest/v1/fs/targets/alertcall/alert_sound12.mp3!metadata). More — Non-standard methods in the path.

The request must not contain a body in either form: a request with a body is treated as a file upload.

Specifics

  • The time in the mtime field is returned in UTC in RFC 3339 format.

  • The content checksum is returned only on a request with the hasha=true parameter. Without the parameter the file content is not read, so the request is cheap regardless of file size.

Request

Table 4. Request parameters
Name Type Description

hasha

bool

Add a content checksum to the response. Default false.

Calculation requires reading the entire file, so for large files the parameter should be specified only when explicitly necessary.

Example request
POST /rest/v1/fs/targets/alertcall/alert_sound12.mp3!metadata HTTP/1.1

Response

Example response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "size" : 3836,
  "mtime" : "2026-07-01T16:47:31Z"
}
Example response with hasha=true
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "size" : 3836,
  "mtime" : "2026-07-01T16:47:31Z",
  "hasha" : "md5;9f86d081884c7d659a2feaa0c55ad015"
}

Move and rename a file

Moves or renames a file within a section without transferring its content.

Performed by PUT on the destination path with the X-Era-Source header and an empty body. The header specifies the source path relative to the section root.

Request

Table 5. Request parameters
Name Type Description

overwrite

bool

Allow overwriting an occupied destination path. Default false.

Example request
PUT /rest/v1/fs/targets/alertcall/<filename> HTTP/1.1
X-Era-Source: inbox/alert_sound12.mp3
Content-Length: 0

Response

Example response
HTTP/1.1 204 No Content

Section root operations

In addition to listing and uploading files, the section root supports two methods.

Request Action

METADATA /rest/v1/fs/targets/alertcall

Section description and information about its root: supported operations, limits, number of top-level elements.

CLEAR /rest/v1/fs/targets/alertcall

Clearing the section: all contents are deleted, the section itself remains. The operation is recursive and requires key confirmation.

The section cannot be deleted: DELETE on the root path always returns 405.