Attachments
The Zobot can send attachments to visitors during a chat just like how an agent does.
Attribute | Mandatory | Description | Values |
type | Yes | The type of the input to be dispalyed to the visitor | file |
text | Yes | Text to be shown along with the attachment | { "Required text" }, |
url | Yes | Downloadable URL from which the file will be downloaded by the bot to be shared to the visitor | { "$url" } |
header | No | Headers that have to be sent while downloading the file from the url | "headers": { "Authorization":"Zoho-oauthtoken xxxxx" }, |
Channel compatibility and limitations
Pro Tip: Facebook Messengers, Instagram, WhatsApp, Telegram, and LINE channels do not support this card. However, you can handle it differently using the channel value in the visitor map. For example, provide an if condition statement (if the visitor's channel is Facebook or Instagram) and handle this case alternatively.
Output
The above is an example to display an attachment to your website visitors.
Use Case
Copied{
"type": "file",
"text": "Here's something that might help.",
"url" : "http://zylker.com/files/reports.pdf"
}
Copied//Context handler function
result = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
{
"type": "file",
"text": "Here's something that might help.",
"url" : "http://zylker.com/files/reports.pdf"
}
]);
prompt = Map();
prompt.put("param_name", "reply");
prompt.put("data", response);
result.put("prompt", prompt);
result.put("todo", "prompt");
return result;
//Execution function
result = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
{
"type": "file",
"text": "Here's something that can help.",
"url" : "http://zylker.com/files/reports.pdf"
}
]);
result.put("data", response);
return result;
Copied{
"type": "file",
"text": "Here's something that might help.",
"url" : "http://zylker.com/files/reports.pdf"
}
Copied{
"platform": "ZOHOSALESIQ",
"action": "reply",
"replies": [
{
"type": "file",
"text": "Here's something that might help.",
"url" : "http://zylker.com/files/reports.pdf"
}
]
}
Copied"channelData": {
"zohosalesiq": {
"replies": [
{
"type": "file",
"text": "Here's something that might help.",
"url" : "http://zylker.com/files/reports.pdf"
}
]
}
}
Copied"channelData": {
"zohosalesiq": {
"replies": [
{
"type": "file",
"text": "Here's something that might help.",
"url" : "http://zylker.com/files/reports.pdf"
}
]
}
}