whatsapp-chatbot | Quickly set up a webhook for your Dialogflow agent | Bot library
kandi X-RAY | whatsapp-chatbot Summary
kandi X-RAY | whatsapp-chatbot Summary
Quickly set up a webhook for your Dialogflow agent and WhatsApp.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of whatsapp-chatbot
whatsapp-chatbot Key Features
whatsapp-chatbot Examples and Code Snippets
Community Discussions
Trending Discussions on whatsapp-chatbot
QUESTION
I have created a webhook for WhatsApp Chatbot using Nodejs following this online article: https://dev.to/newtonmunene_yg/creating-a-whatsapp-chatbot-using-node-js-dialogflow-and-twilio-31km
The webhook is linked to Twilio Sandbox for WhatsApp.
I have also provided the DialogFlow Admin API permission to service account on Google Cloud Platform.
When i send a new message from WhatsApp, its received on Twilio and the webhook is triggered but i am getting this error "Error: 7 PERMISSION_DENIED: IAM permission 'dialogflow.sessions.detectIntent' on 'projects/xxxx-xxx-xxxx/agent' denied." on the console on my local machine (i am using Ngrok to tunnel the localhost build to the web and using that URL as the webhook URL in Twilio).
We have a client demo for this feature so any quick help is appreciated. I am placing my dialog flow code and controller code below
dialogflow.ts
...ANSWER
Answered 2021-Jun-07 at 16:46I think the problem is with the service account. Make sure you use the same email which is registered with Dialogflow and GCP and then create a service account.
You can safely do this by going to the settings menu on Dialogflow and then click on the project id, it will take you to the correct place.
Also, there may be a possibility that you forget to enable the Dialogflow API from the API section on GCP.
QUESTION
I referred to the Twilio blog published by Mwangi Kabiru:
https://www.twilio.com/blog/serverless-whatsapp-chatbot-python-google-cloud-functions-twilio
I made the necessary changes to the code to extract Google Sheets data from Google Drive and send it to Twilio chatbot(autopilot) via webhook. According to Google Cloud Function logs, the webhook successfully transmitted the information to the Twilio chatbot(autopilot) based on its request. But, Twilio is throwing 'error - 90100':
Invalid Autopilot Actions JSON: Invalid Autopilot Action Possible Causes Actions JSON does not comply with the Actions Schema (https://carnelian-neanderthal-8008.twil.io/assets/ActionsSchema.json)
Possible Solutions Test your JSON response against the Actions Schema (https://carnelian-neanderthal-8008.twil.io/assets/ActionsSchema.json)
How to download the JSON file of the webhook created on Google Cloud Function and test it against the Twilio Actions Schema? Can someone please help me to resolve this issue?
Google Cloud Function code:
...ANSWER
Answered 2021-May-07 at 08:54When you're calling a URL from Twilio Autopilot via redirect
you need to return a JSON for Twilio Autopilot not TwiML.
You need to change the part where you're constructing your return message:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install whatsapp-chatbot
Navigate into directory: cd whatsapp-chatbot
Launch the project npm install
Launch the project npm start
Expose the webhook to test your agent with ngrok ngrok http 3031 and test in http://localhost:4040/inspect/http
Link your agent to your webhook in the Dialogflow Console https://<ngrok_url>/dialogflow-webhook
Link your WhatApp webhook in the WhatsApp Admin Panel https://<ngrok_url>/whatsapp-webhook
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page