dialogflow / dialogflow-fulfillment-nodejs

Dialogflow agent fulfillment library supporting v1&v2, 8 platforms, and text, card, image, suggestion, custom responses
Apache License 2.0
597 stars 281 forks source link

Send pdf file as url link or button from agent #273

Open atsoares opened 4 years ago

atsoares commented 4 years ago

Hi, I would like to know if is possible to attach a file or call an intent that calls to something like this:

function downloadPDF(pdf) {
    const linkSource = `data:application/pdf;base64,${pdf}`;
    const downloadLink = document.createElement("a");
    const fileName = "vct_illustration.pdf";

    downloadLink.href = linkSource;
    downloadLink.download = fileName;
    downloadLink.click();
}

The documentation is lacking for custom payload. The only example is audio file.