Search code examples
google-cloud-platformdialogflow-estelegram-botdialogflow-es-fulfillment

Use DialogFlow with external API and with telegram


I wanted to integrate Dialogflow with telegram-bot and external API, but to use external API in Dialogflow one needs to enable billing. So the question is if I enable billing, will I be charged to hit external API in Dialogflow fulfillment? If yes how much?


Solution

  • First, let's clear up a misconception - you do not need to enable billing to use an external API. If you use the built-in fulfillment editor, you will be using Google Cloud Functions which may incur charges (more on that in a moment), but you do not need to use the built-in editor.

    You can setup a web server anywhere you wish to handle your fulfillment webhook as long as it meets these two criteria:

    1. It is at a publicly available IP address (ie - Google can reach it, it isn't behind a firewall or has a private address).
    2. It can handle HTTPS POST requests not using a self-signed certificate.

    So if you have your own server, or wish to run it on AWS, you don't need to enable billing.

    If you do wish to use the built-in editor, and thus use Google Cloud Functions, you need to have billing enabled. However, this doesn't mean you'll be billed. There is a pretty generous free-tier for Google Cloud Functions which should be enough for your basic experiments and probably light usage. Once your code becomes more advanced - you should move it to something more directly under your control.