2

So I'm currently trying to have an intent trigger an http request but keep getting errors.

When the intent triggers this code is executed

 const https = require('https');
 https.get('*************', 
  (resp) => {
    let data = '';

    resp.on('data', (chunk) => {
    data += chunk;
    });


    resp.on('end', () => {
    console.log(JSON.parse(data).explanation);
    });


  }).on("error", (err) => {
    console.log("Error: " + err.message);
  });

When running the intent I get Error: getaddrinfo ENOTFOUND back

My code works fine when I run it locally so the issue appears to be something not lining up properly with dialogflow

If anyone has any advice I would greatly appreciate it.

Thanks!

sidelaunch
  • 57
  • 6
  • Hello, please check if this helps: https://stackoverflow.com/questions/17690803/node-js-getaddrinfo-enotfound – Amanda Cavallaro Aug 14 '18 at 19:57
  • Hi thanks for the reply but that doesnt do the trick, the actual request works fine outside of the dialog flow fulfilment so I'm thinking it must be part of the DF infrastructure. – sidelaunch Aug 14 '18 at 20:24
  • Is your Action hosted using Firebase Cloud Functions on the free plan? If so then I believe you are limited to endpoints in Google's cloud. – William DePalo Aug 14 '18 at 20:52
  • What's the IP alias (the *s)? Silly question, but it's not a local server name, right? – Bela Vizy Aug 14 '18 at 22:26

1 Answers1

3

Dialogflow fulfillments are hosted as firebase cloud functions. Firebase free plan only allows Google service API. If you want to use an external API, you will have to upgrade your plan.

More information can be found here https://firebase.google.com/pricing/

Shubhang Arora
  • 290
  • 1
  • 4
  • 17