Skip to main content

file

To send files in a chat, use the file reply type.

Properties

PropertyTypeRequiredDescription
fileUrlStringYesFile URL.
fileNameStringNoFile name.
Can be aliased as text or caption.
mimeTypeStringNoFile media type.

Syntax

{
"type": "file",
"fileUrl": "https://example.com/file.xlsx",
"fileName": "file.xlsx",
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}

Channel restrictions

file is only supported in the following channels:

  • Chat API

  • Chat widget

  • edna WhatsApp 2.0

  • Microsoft Teams

    tip
    The preferred way of sending files in Microsoft Teams is to use the raw reply type.
  • edna.chatCenter

  • Webim (External Bot API 2.0)

How to use

state: SendManual
a: To configure the service, follow the steps described in the instruction below.
script:
$response.replies = $response.replies || [];
$response.replies.push({
"type": "file",
"fileUrl": "https://example.com/manual.pdf",
"fileName": "manual.pdf",
"mimeType": "application/pdf"
});