0
votes

I'm a newbie to DialogFlow and I don't event know if what I want to achieve is possible.

I'm trying to create a DialogFlow intent that would make an HTTP request from the user device after receiving a given command. I know how to do this with webhooks, but problem is that webhooks HTTP requests come from Google servers, and not the user device.

The reason why I want the request to come from user device is that the receiver will only listen to local network (it's a web server running in an internet router). So this will only work if the HTTP request comes from a device connected to the router.

A workaround could be to create a public tunnel to the router (with softs like ngrok), but my application aims at real users, so I would prefer to avoid this complex setup.

Is it possible to do local requests with DialogFlow? Or is there another Google-Assistant API I could use for this purpose, like Google IoT solution?

Thanks

1

1 Answers

1
votes

You could do this, but you wouldn't necessarily do it like a regular Dialogflow project. Here are the steps:

  1. Build your Action through Dialogflow and add web fulfillment
  2. Add a way to push a notification of some sort to your local device
    • This could listening to a database, polling, push notifications, etc.
  3. When your device gets that notification, it performs the action locally
  4. If you want this local action response to be sent back, you could update the webhook through an HTTP response (if making an HTTP call) or updating a field in a cloud-based database.
    • Actions do have a timeout of around 5 seconds to get a response, so be aware of that limit if you want to do this