I wanted to use dialogflow fulfillment and google cloud storage to set up an intent in the inline editor so that when a user triggers the intent a pdf file is sent to them. But unfortunately it does not work for me yet. I would be so grateful for help.
This is what I tried:
function sendPDF(agent) {
const pdfBucket = 'mybucket';
const pdfFileName = 'file.pdf';
const pdfUrl = `https://storage.googleapis.com/${pdfBucket}/${pdfFileName}`;
agent.add('Here is your file:');
agent.add(new Card({
title: 'Download PDF',
buttonText: 'Download',
buttonUrl: pdfUrl
}));
return Promise.resolve();
}
intentMap.set('myIntent', sendPDF);