Attachments for Zia Skills

The Zobot can send attachments to visitors during a chat just like how an agent does.​

AttributeMandatoryDescriptionValues
typeYesThe type of the input to be dispalyed to the visitorfile
textYesText to be shown along with the attachment

{

"Required text"

},
urlYesDownloadable URL from which the file will be downloaded by the bot to be shared to the visitor

{

"$url"

}

headerNoHeaders that have to be sent while downloading the file from the url

"headers":

{

"Authorization":"Zoho-oauthtoken xxxxx"

},

Use Case:

Context Handler function:

Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies",  [
    {
      "type": "file",
      "text": "PFA",
      "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:

Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
    {
      "type": "file",
      "text": "PFA",
      "url" : "http://zylker.com/files/reports.pdf"
     }
  ]);
result.put("data", response);
return result;

Output: