What is the Dialogflow webhook format? I want to capture the data in an MVC controller and then respond to the webhook whilst maintaining context. How do I do this in C# with the Dialogflow v2 client library? I haven't found any examples to follow in this language and am unsure how to capture the data.
You can read more about Dialogflow webhook format here. Regarding the Dialoglow v2 client library, it is specifically stating that you don't need to use it and can answer in JSON instead using JObject.
If you want to use Protobuf to lower the overhead and save some traffic you will have to use utilities from idiomatic cloud libraries described in the previous link.
The "Dialogflow V2 client library" is for people who are writing clients that send requests to Dialogflow. Dialogflow calls this a "Detect Intent Request", since you're sending a text string (or audio stream) to Dialogflow and it will determine and process the Intent.
If you're interested in building a Fulfillment webhook that is called when an Intent is matched, then you want to look at the Dialogflow Fulfillment API, which is different. There is no supported library for C# yet, but you can parse and return the JSON. The JSON for V1 and V2 are slightly different (mostly in the names of the fields used, but also occasionally in what the values should be).
You can see the fields for the JSON as well as several examples of the request and response formats. There was also an article on Medium recently posted by a Google Developer Relations member discussing using C# for fulfillment in Dialogflow.
Related
What I'm trying to accomplish?
Send an API (chat.postMessage) from a 3rd party app to a Slack user - Done
The message will have two buttons (approve and decline) which the user can click on - Done
Upon clicking on one of the buttons, Slack should send an API back to the 3rd party app - TBD
Before sending an API, Slack should retrieve an authentication token via API - TBD
Note: I've seen in Slack docs mentioning of /incoming endpoint (also /interactive-message). My 3rd party app has a strict set of available APIs. I'm not able to create new API endpoints. Also, I need the payload to be sent in a specific JSON structure.
I've reviewed Slack documentation but I can't figure it out.
Making notifications actionable
I'm technical but not a developer so there might be nuances which I'm missing.
Is there any section in Slack where I can add custom code to accomplish such integration?
If not, how I can accomplish it?
Edit:
I've configured a Request URL (in slack), when I click on one of the buttons in the message, I can see an API request is being sent to the URL.
I'm able to see the payload as well.
My problem is that I need the information to be sent in a different format and to a different endpoint.
What is the best approach to take for this? Do I need to develop a new service to capture and parse the payload and then generate the API request to my 3rd party app?
Ok, so here is how I've accomplished it.
Upon clicking a button in slack, Slack sends an API with a certain payload to the predefined endpoint which you configure (Request URL).
I've used free tier AWS serverless components:
API Gateway and Lambda
API gateway receives the payload and invokes the Lambda function (I used Python as it seems the easier for a non developer)
My Lambda function is processing the payload and has the logic to interact with my 3rd party app in the required way.
We are migrating from BotFramework-Webchat v3 to v4. Usually we send a message from the chat through the directline object created from v3 BotChat using the directline.postActivity function. However in our v4 implementation there were issues with the behavior of messages shown in the chat window when posting activities like this.
It seems that sending messages through the webchat redux store as shown in this example is the recommended approach.
I am wondering what is the difference between these two usages? It seems something is different between v3 and v4 versions and I am having difficulty finding references in the documentation about this. Should directline.postActivity be avoided completely?
It isn't documented anywhere, but best practice is what is demonstrated via the samples, by use of the Web Chat redux store and its list of available actions.
Essentially, Web Chat v4 is built on top of BotFramework-DirectlineJS which does use observables. Web Chat then translates the Direct Line observables into its own methods for consumption internally and by the user.
As you noted, it is possible to use the Direct Line observables in Web Chat but it is neither the best method nor the best practice to do so. Primarily, because Web Chat wasn't specifically designed around their use, except internally. It can work, but it opens you up to potentially curious behavior.
I read an article about Microsoft Flow. I was wondering if it is possible to trigger events using this in an external website.
For instance, supposing a post is made on Yammer for some approval flow based application. If an authorized user comments saying "Approved", this must trigger an action in my external website.
Is this feasible using Flow?
You can also make your own custom connectors if your website has a RESTful API. https://learn.microsoft.com/en-us/flow/register-custom-api
There is an event for Yammer in Microsoft flow. I have something set up similar for my company and Twitter. When our company is mentioned it sends a message off to our social director.
I have several such flows for things like Yelp, Twitter, Facebook.
You need your Yammer account.
The events that you can trigger from and then include a trigger word or phrase are:
Get All messages
Get Messages in a group
Get Messages from my Following Feed
Post Message
Once you have that trigger its simple enough to look for the key word within a condition step.
Chances are good there is already a template for this in Microsoft Flow. Just look at the ones for Yelp, Facebook, etc. and modify for your needs
Just as AJAX mentioned, you can apply your own Custom Connector for a case like this. A Connector is the "plugin" used with a Flow, such as Yammer.
It's a bit late since November 28th (practically a 30-day late response here), but PowerApps allows you to create your own Custom Connector applying Microsoft's API. You'd be able to plug into your website (GET, POST, etc) directly with this when you create a trigger (the condition met true) that would launch an action. If you created your own API, Microsoft would have to validate if it's met standards pertaining to security.
By applying PowerApps, you'd be able to create your own actions and triggers. From this, you can integrate your own web based process' based on documentation that was observed: https://powerapps.microsoft.com/en-us/blog/brand-new-custom-api-experience-in-powerapps/. From here, you'd be able to customize it was needed.
JSON is required for some circumstances, however Postman would be a great IDE to consider as it also applies a pre-approved API by Micrsoft.
Can Luis be used in Bots designed on a platform other than MSFT Bot Framework like chatfeul.
After training a LUIS model, you get an endpoint which is a REST service that can be called. You can then pass parameters to this, modify it according to need and get a JSON response.
You can read more about connecting an API to chatfuel here
I need some guidance on what steps I should follow to receive sms messages using service from www.nexmo.com.
I am not familiar with asp.net but I am very familiar with C# on windows, so please if you can provide a few steps to get me going then I can pick it up from there. Right now I have an account at www.godaddy.com, so I am hoping I can write the code to place it there. I don't really need much details on how to use nexmo service, I mainly need to know what I should do on my web site to receive sms from nexmo.
Incoming SMS's are simply HTTP requests to your 'page'. Nexmo send's the SMS and related data just like a HTML from submits data to a URL using a GET (query string) or POST (form encoded),
So all you have to do is point Nexmo to the URL you want to use, and check the incoming request for the data. Here's the documentation for incoming messages.
Here's a community authored C# library that might be be helpful.
(Disclaimer: I do a bit of developer evangelism for Nexmo.)