Most if not all messengers support attachments for users to share documents with a chatbot.
Unfortunately, chatbots don’t control the messenger and therefore users could send attachments to a point in time where the bot does not expect an attachment to be sent. While you cannot prevent users from sending attachments, you can handle the gracefully. This article explains how you can suppress attachments in Oracle Digital Assistant skills.
How attachments are sent
Attachments are sent as JSON objects that contain information about the type of attachment and the URL from which the bot can download the document.
When a conversation state is waiting for user input and that user input is not validated against an entity but is stored in a string variable, users who upload attachments without being prompted for an attachment actually risk to interrupt the conversation flow. To avoid this in Oracle Digital Assistant, you can use a default transition handler in a skill that detects an attachment to be received and then prints a user message before proceeding with the current state of the conversation.
The sample skill that you can download at the end of this article has two conversation states defined where users a prompted for input. In both cases, the user input is not validated against entity type variables and therefore happily accept an attachment being uploaded. Read the complete article here.
For regular information become a member in the Developer Partner Community please register here.