Skip to main content

audio

To send an audio file to a chat, use the audio reply type.

tip
You can also use the equivalent audio DSL tag or the $reactions.audio method.

Properties​

PropertyTypeRequiredDescription
audioUrlStringYesAudio file URL.
audioNameStringNoAudio caption.
Can be aliased as text or caption.
httpHeadersStringNoThe HTTP headers you want to pass.
Supported HTTP headersUniversal HTTP headers:
• Authorization
• Content-Type
• Content-Encoding
• Content-Disposition
For AWS and MinIO S3 storages:
• x-amz-date
• x-amz-content-sha256
• x-amz-acl
• x-amz-server-side-encryption
• x-amz-storage-class
• x-amz-meta-
For Selectel S3 storages:
• X-Auth-Token
• X-Delete-After
• X-Delete-At
• X-Object-Manifest
• X-Container-Meta-
• X-Object-Meta-
authStringNoThe authentication scheme and authentication key. Enter it if the audio file is in private storage.

Syntax​

  • If your audio file is in a public storage:
{
"type": "audio",
"audioUrl": "https://example.com/example.mp3",
"audioName": "Example"
}
  • If your audio file is in private storage, you can specify the authentication key in several ways:

    tip
    Use secrets to store keys and other sensitive data separately from the project source code.
{
"type": "audio",
"audioUrl": "https://example.com/example.mp3",
"audioName": "Example",
"httpHeaders": {
"Authorization": "<Authentication scheme> <Authentication key>",
"<HTTP-header>": "<Value>"
}
}
{
"type": "audio",
"audioUrl": "https://example.com/example.mp3",
"audioName": "Example",
"httpHeaders": {
"<HTTP-header>": "<Value>"
},
"auth": "<Authentication scheme> <Authentication key>"
}

Channel restrictions​

audio is not supported in the following channels:

  • Bitrix24
  • Chat2Desk
  • Jivo
  • Marusia
  • Salut
  • Slack
  • Viber
  • Webim (Custom Channel API)
  • WeChat
  • Zendesk
  • Zendesk Chat

How to use​

state: Welcome
q!: $regex</start>
script:
$response.replies = $response.replies || [];
$response.replies.push({
"type": "audio",
"audioUrl": "http://bucket-name.s3.amazonaws.com/welcome.mp3",
"httpHeaders": {
"Authorization": "Basic 12345",
"X-Amz-Content-Sha256": "12345678910",
"X-Amz-Date": "20120325T120000Z"
}
});