Posts tagged with dialogflow-es

I am trying to set up a facebook messenger chatbot using dialogflow, and when I am trying to integrate both the services, I get this error message

com.google.dialogflow.bots.common.exceptions.BotWasNotStartedException: Code 400: (#100) You must set a Get Started button if you also wish to use persistent menu.

I tried the method referred in this question : get started button for fb messenger in dialog flow (get started button for fb messenger in dialog flow)

but it threw the error when I tried sending a POST request as given in the answer : "error": {"message": "(#100) Requires one of the params: get_started,persistent_menu,target_audience,whitelisted_domains,greeting,account_linking_url,payment_settings,home_url,ice_breakers,platform,title,description,commands", What do I do and how do I proceed from here? Is there a PHP or a JSON code that I must integrate? Or is there something else I can do about it?

Error message in dialogflow while trying to integrate messenger and dialogflow : com.google.dialogflow.bots.common.exceptions.BotWasNotStartedException: Code 400: (#100) You must set a Get Started button if you also wish to use persistent menu.

Error message while trying to send a POST request to set a Get Started button : "error": {"message": "(#100) Requires one of the params: get_started,persistent_menu,target_audience,whitelisted_domains,greeting,account_linking_url,payment_settings,home_url,ice_breakers,platform,title,description,commands",

I'm sending the PDF document to WhatsApp number, which is been successfully sent to the user but the title of the document is getting displayed as Untitled.

WhatsApp Business API version we are using is v2.21.6. I've referred to the documentation of WhatsApp Business API where it explains how one should send the document with ID or link. Documentation link https://developers.facebook.com/docs/whatsapp/api/messages/media

This is my file object to send the file to WhatsApp Number,

const fileDetails = {         mime_type: 'application/pdf',         id: uploadFile.media[0].id(media id),         filename: fileName[3]( file name which we have to show)       }; 

and below is helper function to send the message,

function getMessageByContentType(contentType,   link,   id = '',   filename = '',   caption = '') {   const contentTypeMessageMapper = {     audio: {       type: 'audio',       audio: {         id,       },     },     document: {       type: 'document',       document: {         id,         filename,         caption,       },     },     video: {       type: 'video',       video: {         link,       },     },     image: {       type: 'image',       image: {         id,         link,       },     },   };  //Method to send document to user WhatsApp mobile number  yield whatsAppMessage.sendWhatsappMediaMessageToUser(     bot,     userId, //Mobile number     fileDetails //File object.   );     //POST request     {   "method": "POST",   "json": true,   "headers": {     "content-type": "application/json",     "Authorization": "Auth Token"   },   "body": {     "type": "document",     "document": {       "id": "a0706671-4fe7-49b0-8d1b-bcfb2fc5f7e8",       "filename": "fileName.pdf",       "caption": ""     },     "recipient_type": "individual",     "to": "Mobile Number"   },   "uri": "https://WhatsApp-Business-API-URL/v1/messages",   "rejectUnauthorized": false } 

After uploading binary file to WhatsApp Business API, we are using the ID to send the file to the customer which is getting uploaded successfully without any error message but the filename is coming as "Untitled" and not taking filename from the file object.