Asynchronous messaging in api.ai - dialogflow-es

I require to send messages asynchronously from my service to api.ai and then api.ai would send it to Facebook Messenger.
To achieve asynchronous messaging I have used custom events.
But on using custom events, events are getting triggered from webhook, and messages are going to api.ai but it is not further displaying anything to facebook messenger

Probably you want to add a delay before api.ai replies to user input, right? Than you need to add a delay in your Facebook integration app.
Consider the follow flow
User type a message in Facebook messenger window
Facebook sends the message to your integration app
Integration app sends the message to api.ai
Api.ai responds to the message and send the reply to the integration app
Integration app wait for a while and than sends the reply to Facebook
Regards

Related

facebook webhook not receiving messages via messenger

So I'm tryin to get messages via messenger webhook. It is working well locally but when I try to send a message through messenger the callback(which is Heroku) isn't happening.
I was sending the messages with an account which had no role in the app and which was also a developer account which had Admin role.
I have subscribed to messages, messaging_postbacks, message_deliveries, message_reads, message_echoes, standby events for my webhook and added my page to it. I dont necessarily think im missing anything.
...a little help Captain??
Edit: I am now obtaining messages sent by clicking test button, but not when other developer accounts sent message through messenger

is it possible to send broadcast messages using Twilio whatsapp API

I am trying to integrate Twilio WhatsApp API with my application, is it possible to send broadcast messages using Twilio.
Twilio developer evangelist here.
You can send outbound messages over WhatsApp using Twilio. There are some constraints though.
You need to get your users to explicitly opt in to receive WhatsApp messages
When you send a notification to a user, if it is more than 24 hours since the user sent you a message you can only send approved template messages.
Twilio Notify does not support WhatsApp, so to broadcast messages to a group of users you will need to make one API request per message using the regular Twilio messaging API.
Let me know if that helps at all.

only messages from my facebook profile to the bot triggers the call to my webhook

I followed this twilio tutorial on how to set up facebook messenger. However this bot only triggers my webhook when I send a message to it on my facebook profile. The webhook I set up isn't called at all when any other facebook user sends a message to my bot.
I've tried getting the other user to follow and like the bot's page and also getting the bot to reply back. It seems only messages from my facebook profile to the bot triggers the call to my webhook. how can I fix this?
You can fix it by submitting your app for review.
Before you do that, it will only work for user accounts that have a role in the app.
https://developers.facebook.com/docs/messenger-platform/submission-process and https://developers.facebook.com/docs/app-review
provide more detailed information on the whole process.

Slack API client for push notification

I'm building a Slack (instant messaging) chat client, I'm looking for a way to trigger a notification to receipent when a new message is sent to him, push notification of course.
What's the endpoint or stream API to be able to trigger a push notification to devices?
I think it should be some backend microservice listening for incoming messages in a channel with a list for users to notify.
If you want to get instant notifications about new messages posted to a channel you can either use the Real Time Messaging API (RTM API) or the Events API.
The main difference:
RTM API uses Websockets and you will receive a constant stream of events about everything that happens on the connected workspace.
Events API uses standard HTTP requests and Slack will only send events to your endpoint that you subscribed too.
There are many factors to consider when choosing the right API for a project. Please also see the official FAQ from Slack on the topic for more details.

How do I get the auth token from api.ai to send message to slack?

I have a case where I need to create a Bot in Slack that my users can use conversational language to get information out of my web app in real time. The scenario goes something like:
User asks the bot something like: #hrbot How many employees are in the Finance department?
Bot send the string to API.AI/ diagflow to resolve into a JSON request
API.AI sends the JSON request to my Web App endpoint via webhook to get the answer
Answer is returned to user's Slack channel
Question:
1. How do I get the auth token from api.ai to send message to slack?
With Dialogflow (formerly API.AI) you provide a webhook (a HTTPS URL where your server is) and Dialogflow will send a HTTPS request to your webhook when requests come to your Dialogflow agent. You can enable the Slack integration in your Dialogflow agent through the web interface and all requests from Slack will be sent to your Dialogflow agent and (if you configure it) to your webhook with NLU information and the original request from Slack.
Information about the request that is sent to your webhook is documented here: dialogflow.com/docs/fulfillment#request if you respond to the request the response will be forwarded to the user that trigger the request. The response format is documented here: dialogflow.com/docs/fulfillment#response

Resources