make a dialogflow webhook receiver in django - django

Hi I'm setting up a chatbot using dialogflow, what I want is to integrate dialogflow with django so that a search function in the django server is executed and the result of the research is passed to the chatbot, I made a webhook to the django server in dialogflow using the url "https://0e3c393b.ngrok.io/webhook" but I dont know how make a webhook receiver in django, Any recommendations ?

You should treat it like any other endpoint on django, you will get a request from Dialogflow with a JSON content body, and you will need to reply back with JSON in a specific format. When you want the search behaviour on the chatbot, at that specific intent or flow, have the action be to use a webhook request.
You can find more information here.
https://dialogflow.com/docs/fulfillment/how-it-works

Related

No data posts by my Kotlin appliaction to Django Rest Framework

I made a Authorizing system with SMS which gets number of an application then makes account and with verify code it let user to login. the problem is that when I send data by Retrofit in Kotlin as POST ,it sends no data (None) to server and Django logs show that no data sent for it. I know my Django API is working truly because of that POSTMAN works with it but my Kotlin application doesn't. Here I used APIService "Kotlin Intrface" class like this you see as below:
#FormUrlEncoded
#POST("v1/register/")
suspend fun RegisterRequest(
#Field("mobile") mobile: String
):Response<Reply>
I expected to see in logs that data sends for server but it doesnt work.
Also maybe you say that it needs Header but no ,cuz of I tried to set header for it also its Register and doesn't need token or anything like this and there's no persmission for it in server side.

DialogFlow, modify user request

for my dialogflow project I would like to intercept the user request before the dialogflow responds with the appropriated intent.
My goal:
-The user sends a request with an input message
-I access this message, I transform it (I apply a function to it) and then it is delivered to the dialogflow (so dialog.
I'm using a webhook linked to an specific intent. I'm using cloud functions to handle the webhook.
I would like to access the request using this webhook, modify the original request and allow dialogflow to respond according to this new modified request.
I hope I've made myself clear.
Thank you very much in advance!
I think it is not possible using a webhook, I suggest you to take a look at the Dialogflow fulfillment documentation. As you can see in the architecture representation, your webhook is behind of the intent matched, so the user request has been processed by Dialogflow and the fulfillment will perform actions based on the matched intent, so you only be able to modify the task on the service that you defined within the fulfillment and its response.
You could be able to do this according to your use-case, if you're using a custom development to make calls to the Dialogflow API, you can add an additional step between End-User and Dialogflow where you could intercept the user request, modify it and then send it to the Dialogflow API.
If you’re using any integrations such as Action on Google or Dialogflow Hangouts, this will not be possible since these services are the ones that manage the calls to the Dialogflow API.

setting up django server for receiving callbacks from jira and other apis

how can I start receiving and parsing callback api's responds in further with Django server?
I wanna setup my DRF server to start working with JIRA webhooks, but also it might be useful for other apis such as telegram and etc. In this case I need to provide them my server's url where I would expect new events/data, but atm I don't realise what it means exactly. Where do I need to start digging in?
Not sure about the apis you are talking about but if the api sends some callbacks you'll give them a url, mysite.com/whatever
make your url config like normal
and in your view you can parse the result
def my_callback_view(request):
# assuming it's a POST request
data = request.POST
... do whatever with the data

payment gateway integration with emberjs

I have build an eCommerce website using emberjs with ember-data-1.8.0.On Api side i am using Hapijs.
I have integrated Payu payment gateway with it,but i am not able to handle response send by payu.After payment payu send a post response to given route of ember, but How will i handle this response and will get all payload so i can send request to my hapi server.
i have no clue how to do it, if there is some doc or example of integrating payment gateway and emberjs, please mention it also.
Thanks
Ember is a client side framework, Payu will not be able to send a "post" request to ember it may perform it on your Hapijs backend however. Then you have many options to check events on your backend from your frontend for example through sockets or via a setInterval which queries a given page every N seconds.

FireBase connect to server (Not NodeJS)

So I've seen this answer Using NodeJs with Firebase - Security that talks about syncing NodeJS with the Firebase data structure.
I don't use NodeJS (being a Railo/Coldfusion developer) and was wondering if something like this is possible outside of NodeJS? Through java or maybe just using REST endpoints. Or do I have to use the original solution in the above link of separately updating the data in my webserver.
Another way of wording it is; can I make a round trip from firebase to an HTTP server that isn't nodeJS?
EDIT: To clarify, exactly what I wanted to do was have a email webservice post to the REST API of Firebase, then firebase post that to an URL on my external railo server as my users need to know when the email arrives but the server just needs to make sure it stores it.
As I understand it my best bet is to get the email webservice to post to the URL on my railo server which then posts to the REST API on firebase.
Yes you can.
Firebase does not have a Coldfusion client library, so you need to use the REST APIs. You can use the REST API to read / write Firebase data from your server code.
The one thing you'll be missing is the notifications when data changes. With the node.js client, you can subscribe for updates to data but there's no way to do that from a REST API.
So if you need to know when Firebase data changes, and you're using REST, you'll have to poll the data periodically.
(Note: This is mostly copied #Michael's answer in the comments)