Sending immediate response and detailed message in DialogFlow - facebook-messenger

I have a requirement of sending two messages from my chatbot. The first message will be send immediately as a response like "please wait for a moment" and the second one will be sending after an API call.
I'm using Dialogflow with Facebook messenger. Is it possible in Dialogflow send an immediate message and later send a detailed one?

No, you can't send two responses asynchronously. You could show two simple responses but those would be sent at the same time.
app.ask(app.buildRichResponse()
.addSimpleResponse('This is the first')
.addSimpleResponse('and this is the second')
);

I don't know a way to give two responses to the user at different times, but as an alternative, you can give a default response to the user along with the fulfillment response in case something goes wrong on the server side like
Bot: Something went wrong.. please check your internet connection or try again after some time.

Related

How to let users know flow has completed?

I have a flow setup in logicapps that starts with a http response, the user enters data in an excel sheet and clicks a cell/hyperlink which kicks things off. They receive a response saying the flow has started and was wondering how I could update the response once the flow has completed (either successfully or if it has failed). I’ve only created basic flows before and when googling I’m not too sure what I should be searching for but cant find any examples of what I’m trying to achieve, any ideas?
Here is one of the workarounds that might work. You need to add the response at the end of the flow. Consider my logic app as a sample. If my "Var" is yes then in response it sends Success as a response to my postman and if it is other than yes it sends Failed. Here is my logic app for your reference:-
Result:
In postman
In your case, you can use some properties to define if they got classes or not and then use the same condition connector to send the response.

Blank email is sent with Send Email connector in Mule 4

I am using Send Email connector (SMTP configuration) to send email to gmail. It is observed that sometimes email is sent with blank body. Though in the mule log I am able to see that the email body is constructed correctly just before the Send Email connector, but the email sent is having blank body.
Even though this issue is occurring very rarely but would like to know how we can avoid such situation and is there way to handle this situation? Also, what could cause this issue?
Thanks in advance
There could be two (and more) possibilities:
Your payload being json is not getting read correctly, try payload.^raw when working with email body json. Had to do this when sending a multipart/form-data containing json content for email service
Having said this is a rare scenario it could be possible that your error flow is itself throwing an error ( either while building the body / while calling email end-point) which throws off the body and in the 2nd flow error type being changed without a body the email is sent across? Check your flows make sure http calls are surrounded with Untill-successful scope..
With more info, we could dive deep. What do you think ?

Watch request successful but not receiving any messages

I am trying to get Gmail push notifications by setting up a watch notification. I went through all the steps in the Push Notification guide and received a successful historyId/expiration response, but since then all's quiet. I haven't gotten any of the emails pushed through. Any ideas?
AFAIK, your application will only receive a notification message describing the change if the mailbox update matches your watch request.
With this, try to provide the topic name and any other options in your watch() request, such as labels to filter on. For example, to be notified any time a change is made to the Inbox:
POST "https://www.googleapis.com/gmail/v1/users/me/watch"
Content-type: application/json
{
topicName: "projects/myproject/topics/mytopic",
labelIds: ["INBOX"],
}
Other than that, check your Gmail notifications settings. If that still doesn’t work, try the troubleshooting steps given here.

Connection state with libmicrohttpd and http 102

What I am trying to achieved is:
Send http 102 to client who requested somedoc.html
Some processing on the side including out of band authentication
If authenticated, send response built from somedoc.html, otherwise generic not auth message
I'm having a failure of understanding somewhere, in that I cannot seem to figure out how to send the 102 and save the connection details so that I can forward the response in step 3. I had thought I could queue a response then either enter a wait loop or suspend the connection, but as far as I can tell I have to return from the MHD_AcceptPolicyCallback for the response to be sent, then I cannot figure out how to get back to the connection. I have looked at the request completed call back but this still results in the 102 not being sent.
I really can't figure out a process to achieve these steps from the examples or the manual and any help would be appreciated.
HTTP standards doesn't define response code 102.
See https://www.rfc-editor.org/rfc/rfc7231#section-6
and https://www.rfc-editor.org/rfc/rfc2616#section-6.1.1
HTTP protocol use request-response logic. If you already responded to some request then you can't add another response later to the same request.
After talking with the developer, the 102 status code was defined "for completeness"; however, no attempt has been made to implement the required functionality to actually be able to use this status code in a meaningful way on a server developed with the libmicrohttpd library.

Responses to emails sent from the API not threaded

I noticed that when I send messages from the gmail API and then get an email response to them, the response is never threaded with the original message. Repro steps:
On gmail.com, create a new email draft to someone. Don't send it.
Go to https://developers.google.com/gmail/api/v1/reference/users/drafts/list and log in at the bottom. Enter 'me' for userId and click Execute to get the ID for your draft.
Go to https://developers.google.com/gmail/api/v1/reference/users/drafts/send, log in at the bottom, enter 'me' for userId and fill in the ID from step 2. Click Execute to send the draft.
Have the other person respond to your email.
On gmail.com, the person's response is not threaded with the original email that was sent. However, this works just fine if you send from the gmail UI instead of the API. In examining the headers, the only difference is that the API adds a second 'Received' header. I'm not sure if this is the cause of gmail not threading.
Has anyone else seen this? What is the gmail.com UI different from the API when sending a draft?
It was a bug. Barring issues rolling out the fix, should be resolved by next Weds, July 9th.

Resources