0

I am using DialogFlow chatbot to get user information on my website. I was first trying to get data from a page. This is the code :

const https = require('https');

https.get('myWebsiteName.com/apiToGetData', (resp) => {
    let data = '';

    // A chunk of data has been recieved.
    resp.on('data', (chunk) => {
      data += chunk;
    });

    // The whole response has been received. Print out the result.
    resp.on('end', () => {
      console.log(JSON.parse(data).explanation);
    });

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

But when i checked in console, it printed Error: getaddrinfo EAI_AGAIN myWebsiteName.com:443. When I read about it, I got to know that it is a DNS lookup timed out error. But I want to know that is it because of my free version of Firebase and Dialogflow? If I buy their plans, will the same code work?

Sairaj Sawant
  • 1,842
  • 1
  • 12
  • 16
Shashank Gupta
  • 315
  • 1
  • 4
  • 16

1 Answers1

0

You need to enable Billing on your account to make outbound calls. Read this answer to get clarity on the issue.

Sairaj Sawant
  • 1,842
  • 1
  • 12
  • 16
  • As I am using salesIQ bot which I have integrated with my DialogFlow bot. If I have salesIQ bot paid version, will that be okay or will I have to buy DialogFlow account also? – Shashank Gupta Jan 25 '20 at 06:05