Receive a File From the Bot
AVAILABLE API VERSIONS |
---|
Available in API v5.0 only |
Einstein Bots API supports sending file attachments to clients through rich content support. An enhanced bot can send a rich file with the File dialog. The file appears as a downloadable attachment in the client.
If your client doesn't support rich files, you can receive the file as a link in text format.
To set up a bot to send a rich file, see the Send a File from an Enhanced Bot Help article.
For the client to receive file attachments, add richContentCapabilities
with the Attachments
format type to the initial request body when you begin the session. See Begin a Session.
Here, Attachments
is the rich content format type for showing the file as a downloadable button. If your client doesn’t support rich content, but the bot uses a file dialog step, you can include richContentCapabilities
with the formatType
set to Text
. If you don't include richContentCapabilities
, the bot defaults to using the Text
format type. In this case, the bot sends the file as a link in text format.
Here’s an example of a bot response that you receive when the bot sends an attachment and the client supports the Attachments
format type. The response has the messageDefinition
message type and Attachments
format type. In this example, the bot sends an instruction manual file to the customer.
If the client supports the format type Text
instead of Attachments
, the bot sends the instruction manual file to the customer as a URL link.