Skip to content
Permalink
Browse files

Refreshed docs

  • Loading branch information...
mishushakov committed Oct 17, 2019
1 parent c41021c commit 26d9311a8b49e15e4119dbcc492e721caf5d3b98
@@ -315,7 +315,7 @@ POST <BASE_ENDPOINT>

#### Example Request

Note: The examples are in js
Note: The examples are using NodeJS

Multi-Agent scenario using wildcard subdomain on Dialogflow Gateway by Ushakov (Hosted)

@@ -376,14 +376,14 @@ ws.on('close', (code, error) => {

## Implementations

| Title | Developer | Status | Homepage | Features | Cloud-based? |
|-----------------------------------------|-----------|-----------------------------|--------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| Dialogflow Gateway (Hosted) | Ushakov | Stable, actively maintained | https://dialogflow.cloud.ushakov.co | Security Features, API Extensions, Realtime API, support, free updates, uptime guarantees, disaster recovery, dashboard, built-in integrations, pay-per-use, free quota | Yes |
| Dialogflow Gateway (Enterprise Edition) | Ushakov | TBA | https://dialogflow.cloud.ushakov.co | Self-hosted, premium support, API Extensions, free updates | No |
| Fulfillment Tester | Ushakov | Testing | https://github.com/mishushakov/dialogflow-fulfillment-tester | For testing purposes only | No |
| Title | Developer | Status | Homepage | Features | Cloud-based? |
|-----------------------------------------|-----------|-----------------------------|--------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|--------------|
| Dialogflow Gateway (Hosted) | Ushakov | Stable, actively maintained | https://dialogflow.cloud.ushakov.co | Support, free updates, uptime guarantees, disaster recovery, dashboard, built-in integrations, pay-per-use, free quota | Yes |
| Dialogflow Gateway (Enterprise Edition) | Ushakov | TBA | https://dialogflow.cloud.ushakov.co | Self-hosted, premium support, free updates | No |
| Fulfillment Tester | Ushakov | Testing | https://github.com/mishushakov/dialogflow-fulfillment-tester | For testing purposes only | No |

[Submit your implementation](https://github.com/mishushakov/dialogflow-gateway-docs/pulls)

## Contact

If you have any questions/troubles, regarding the API, please [contact us](https://ushakov.co/#contact)
If you have any questions or troubles regarding the API, please [contact us](https://ushakov.co/#contact)
@@ -1,6 +1,6 @@
# Dialogflow Gateway by Ushakov (Hosted)

This directory contains documentation of the hosted version of [Dialogflow Gateway](https://dialogflow.cloud.ushakov.co) by Ushakov
This directory contains documentation of the [Dialogflow Gateway by Ushakov (Hosted)](https://dialogflow.cloud.ushakov.co)

- [Installation](installation.md)
- [Configuration](configuration.md)
@@ -264,7 +264,7 @@ POST <BASE_ENDPOINT>

#### Example Request

Note: The examples are in js
Note: The examples are using NodeJS

Note: Dialogflow Gateway converts `session` into `projects/<Project ID>/agent/sessions/<Session ID>`. This behaviour is a subject to change

@@ -327,4 +327,4 @@ ws.on('close', (code, error) => {

## Contact

If you have any questions/troubles, regarding the API, please [contact us](https://ushakov.co/#contact)
If you have any questions or troubles regarding the API, please [contact us](https://ushakov.co/#contact)
@@ -1,42 +1,32 @@
# Dialogflow Gateway by Ushakov (Hosted) Configuration

Before making any further steps, described below, please make sure, that you have successfully connected your Agent to the Gateway and it is displayed in the console, like in my case:
Before making any further steps, described below, please make sure, that you have successfully connected your Agent to the Gateway and it is displayed in the console:

![Dialogflow Gateway Console](images/1*dNrnAw5_fujrbkv9z3PkDQ.png)
![Dialogflow Gateway Console](images/console.png)

## Get into the configuration screen

Please click on the “Manage” button on the right side of the Agent that you want to configure:
Please click on the “Manage” button on the right side of the Agent that you want to configure

![Dialogflow Gateway Console "Manage"](images/1*6IQ7e85pPwzec-2xpeJ4pQ.png)
The “Manage” screen should pop up:

The “Manage” window should now pop up. Here, select the “Settings” tab to continue:

![Dialogflow Gateway Settings](images/1*dR5bVY4fUuWwgxEdeeqm_A.png)
![Dialogflow Gateway Overview](images/manageagent.png)

## Configuring Webhook

![Dialogflow Gateway Settings (Webhook)](images/1*1mXV-mVBdlEfFbFgxftaNg.png)
![Dialogflow Gateway Settings (Webhook)](images/consolewebhook.png)

The Webhook field allows you to paste a URL to a Webhook, which will receive a POST request from Dialogflow Gateway, when it’s triggered.
The Webhook field allows you to paste a URL to a Webhook, which will receive a POST request from Dialogflow Gateway, when its triggered

It’s great for analytics or building custom functionality on top of Dialogflow Gateway Platform. You can code the webhook in any programming language or framework, but in our example we will use Node and Express.
You can code the webhook in any programming language or framework (in our example we will use Node and Express)

### Example Webhook

Here i have coded the Example Webhook using Webtask.io:
Here is the example Webhook on Webtask.io:

![Dialogflow Gateway example webhook](images/1*1P5DjCpGfLWgP6lQpoV7OA.png)

It doesn’t do much more, than logging the incoming request body. Notice, that this is not the request body which is received by the Gateway, but instead it’s a matched Dialogflow response. In this case you are ensured, that your webhook only receives legit requests and does not need to handle the errors and some edge-cases.

For security reasons, i also recommend authenticating your requests via a secret request parameter or using CORS.

On the Screenshoot, i have highlighted the URL, which points to the Webhook. Paste that URL in the Console and you will see magic happening:

![Dialogflow Gateway example webhook url](images/1*Kpqq20MfRzHgPRkMbkmADg.png)

For your convenience, i have also uploaded the example Code as Gist on Github:
The code:

```js
let express = require('express')
@@ -54,21 +44,29 @@ app.post('/', (req, res) => {
module.exports = Webtask.fromExpress(app)
```

Another thing you need to know about the Webhook functionality, is that it isn’t aware of your Webhook’s health. That means, if your webhook is down, you are not going to be able to receive requests at the time. Dialogflow Gateway isn’t going to retry and has very strict timeouts, so please make sure your webhook responds fast and is durable.
It will log all the incoming requests. Notice, that these are not the requests which are received by the Gateway, instead they were matched Dialogflow responses

For security reasons, i strongly recommend authenticating your requests via a secret request parameter or using CORS

On the previous screenshoot, i highlighted the URL, which corresponds to the Webhook. Paste the URL in the Console and press on "Save":

![Dialogflow Gateway example webhook url](images/webhookurlexample.png)

Note, that Dialogflow Gateway isn't aware of your endpoint's health. If its unavailable, you won't be able to receive requests at the time. Dialogflow Gateway isn’t going to retry and has very strict timeouts, so please make sure your webhook responds fast and is durable

## Connecting Virtual Agent Analytics

![Dialogflow Gateway Settings (Virtual Agent Analytics)](images/1*XZEmrPIvovzEsj3ENKx9Fg.png)
![Dialogflow Gateway Settings (Virtual Agent Analytics)](images/virtualagentanalytics.png)

In this part of the Article, we are going to connect Google’s Area 120 [Chatbase](http://chatbase.com) Virtual Agent Analytics Service to our Dialogflow Gateway in order to get detailed Analytics of our Agent’s usage and reports from the Dialogflow Gateway Platform. Notice that, Dialogflow Gateway has no built-in service for such Analytics and does not store your message history.
In this part of the Article, we are going to connect Google’s Area 120 [Chatbase](http://chatbase.com) Virtual Agent Analytics Service to our Dialogflow Gateway in order to get detailed Analytics of our Agent’s usage and reports from the Dialogflow Gateway Platform. Notice, that Dialogflow Gateway has no built-in service for such Analytics and does not store your message history

![Chatbase Dashboard](images/1*NQdQk2PPVFOrxHa56Q_qqw.png)

![Chatbase Dashboard messages](images/1*62QR5SouuxZH_n9U9epMkg.png)

![Chatbase Dashboard transcripts](images/1*mPnKhb4JonFQprSGAMQEXA.png)

On top of that, Chatbase gives you even more features to play with:
On top of that, Chatbase gives you cool features to play with:

* Metrics

@@ -90,7 +88,7 @@ On top of that, Chatbase gives you even more features to play with:

* Machine learning: Suggested intents for missed & misunderstood messages (Beta)

Excited? Let’s connect our Agent to get it!
Let’s connect our Agent!

1. Sign into [Chatbase](https://chatbase.com/overview) with your Google Account:

@@ -100,42 +98,32 @@ Excited? Let’s connect our Agent to get it!

![Chatbase Add bot](images/1*bitGmbe8nlnrr4IX0Ipcew.png)

3. Copy the API Key for your Bot:
3. Copy the API Key for your bot:

![Chatbase bot API key](images/1*XiohDWc7br_BH_nkjHsLVw.png)

4. Paste the API Key into your Dialogflow Gateway Integration Settings:
4. Paste the API Key in your Dialogflow Gateway Integration and hit on "Save":

![Dialogflow Gateway Settings (Chatbase API Key)](images/1*cP1g1f87V9x7ycNsTf5v1w.png)
![Dialogflow Gateway Settings (Chatbase API Key)](images/virtualagentanalyticsapikey.png)

5. View your Analytics Data

![Chatbase Dialogflow Gateway Analytics](images/1*aKTMHA4wygSZb67T2G3S6w.png)

Notice: Chatbase it can take up to 24 hours to index your messages, so be patient. For your convenience Dialogflow Gateway messages are tagged as “Dialogflow gateway” Platform in Chatbase.

Success! Now we have connected our own Webhook and configured Virtual Agent Analytics Service 🤘

## Sources

![Dialogflow Gateway Settings (Sources)](images/1*mvXf5JQnhnEtcifBEnG3Qw.png)

It’s a little bit difficult to explain this feature for newbies, but no worry, i will do my best, so you can understand, what it does and how you can benefit from it as well!

To understand what problem it solves, have a look at this Example Intent:
Notice: Chatbase can take up to 24 hours to index your messages, so be patient. For your convenience Dialogflow Gateway messages are tagged as “Dialogflow gateway” platform in Chatbase

![Dialogflow Intent Responses Example](images/1*gzRWa6Edve7C17UzmYQiSA.png)
## Settings

As you see in the “Responses” field, there can be different Responses for different Platforms. In the Simulator window, you can manually select, which Platform you want to have previewed:
### Platforms

![Dialogflow Simulator Responses](images/1*-AsFIfJ-1TVUZVcPmYrGQg.png)
![Dialogflow Gateway Settings (Platforms)](images/consolesettings.png)

Of course, in a Real-World application, there is no such selector, so there is also no way to know, which responses Dialogflow Gateway should respect. To solve this problem (and many others) the “Sources” feature was introduced, so you can manually select which Platforms you want to Support in your Dialogflow Gateway Integration.
This feature allows you to target Platforms you want to support through Dialogflow Gateway

## Actions
### Unlink

![Dialogflow Gateway Settings (Actions)](images/1*ZBL4EhjjtVRt__XUWG4kXw.png)
![Dialogflow Gateway Settings (Unlink)](images/unlink.png)

The last, but not least thing is the “Actions” section. You can press on the “Unlink” button, to unlink your Agent from Dialogflow Gateway.
You can press on the “Unlink” button to unlink your Agent from Dialogflow Gateway

Remember, to save your Configuration, after you make any changes
Note: the "Unlink" button is only visible on the "Settings" tab and unlinking will not reset the messages count
@@ -1,14 +1,14 @@
# Dialogflow Gateway by Ushakov (Hosted) FAQ

**Am i required to use Dialogflow Gateway?**
**Am i required to use Dialogflow Gateway in order to use Ushakov's integrations?**

Yes

**Am i required to use Dialogflow Gateway *by Ushakov*?**

No, Dialogflow Gateway API is free for anyone to implement ([see the docs](./../README.md))
No, Dialogflow Gateway API is free for anyone to implement ([see the docs](./../README.md)). However, we will not provide support for any integrations, that use your variant of Dialogflow Gateway

**What happens to my personal data on Dialogflow Gateway?**
**What happens to my personal data?**

This is a subject of the [Privacy Policy](https://cloud.ushakov.co/privacy)

@@ -22,13 +22,13 @@ No, only the count of messages you sent us is stored for our billing purposes

**What happens if the service shuts down?**

Every affected customer will get a free Enterprise Edition of the Dialogflow Gateway
Every affected customer will get a free self-hosted variant

**What happens when you change the API or Terms?**

You will be notified via the E-Mail, that you used to sign up

**What if Dialogflow V2 will be deprecated?**
**What if Dialogflow V2 is deprecated?**

You will get a free upgrade

@@ -40,10 +40,10 @@ No!

If you are over the free quota, you will get a e-mail on the 1th of the following month containing instructions on how to transmit your payment

For any further questions, [contact us](https://ushakov.co/#contact)

**Why is my integration displayed as "Blocked"?**

![Dialogflow Gateway Blocked](./images/blocked.png)

Likely, because it violated our ToS and system decided to hold it. Get in touch, to learn why it happened to your project and how you can resolve it
Likely, because it has violated our ToS. [Get in touch](https://ushakov.co/#contact) and find out, why it happened and what you can do

For any further questions, [contact us](https://ushakov.co/#contact)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,37 +2,37 @@

## Step 1: Get a Service Account

Service Accounts represent identities of a Service (much like user account represents identity of a user). Dialogflow Gateway requires a Service Account, to authenticate the requests, as they were triggered from your service. In this step, we will generate such Service Account for your Google Cloud project, that is connected to your Agent.
Service Accounts represent identities of a Service (much like user accounts represent identity of a user). Dialogflow Gateway requires a Service Account to authenticate the requests as they were triggered from your service. In this step, we will generate such Service Account for your Google Cloud project that is connected to your Agent

Visit [Google Cloud IAM](https://console.cloud.google.com/iam-admin/serviceaccounts)

Make sure you are on the Service Accounts” Page and have selected the Project, which your Dialogflow Agent is associated with
Make sure you are on the "Service Accounts" page and have selected the project, which your Dialogflow Agent is associated with

Then, press on the “Create Service Account button
Then, press on "Create Service Account" button

Enter the name of your Service Account and press on Create
Enter the name of your Service Account and press on "Create"

![Dialogflow Gateway Service Account creation](images/0*8iYHLAGC8Qc5APhY.png)

## Step 2: Grant permissions to the Service Account

You have now successfully generated a service account! You just need to give it some permissions, so it can access certain resources of your Google Cloud project.
You have now successfully generated a service account! You just need to give it some permissions, so it can access certain resources of your Google Cloud project

We will need thoose permissions: Dialogflow API Client and Dialogflow API Reader
We will need following permissions: "Dialogflow API Client" and "Dialogflow API Reader"

It’s important, that you set these permissions, otherwise your integration may not work as expected

![Dialogflow Gateway Service Account permissions](images/0*ZtCBwK0pme7dkEUa.png)

Set the Roles and press on Continue
Set the Roles and press on "Continue"

## Step 3: Get the keys of the Service Account

In the this step we will generate the keys of our Service Account, which we will later give Dialogflow Gateway access to.
In the this step we will generate the keys of our Service Account, which we will later give Dialogflow Gateway access to

Press on Create Key Button and in the Create Key window set the Key type to JSON. Then, press on Create”.
Press on "Create Key Button" and in the "Create Key" window set the "Key type" to "JSON". Then, press on "Create"

The keys should been downloaded to your default Downloads folder. Make sure to check that as well.
The keys should been downloaded to your default Downloads folder. Make sure to check that as well

![Dialogflow Gateway Service Account keys](images/0*Bw3c0_7Az-MWc4gD.png)

@@ -46,16 +46,14 @@ Sign in with your Google Account

And you will see the console

![Dialogflow Gateway Console](images/0*3WG-EcS8ae8H6mYR.png)
![Dialogflow Gateway Console](images/console.png)

In the Agents section press on the Upload button and select your keys
In the "Agents" section press on the "Upload Keys" button and select your keys

![Dialogflow Gateway Service Account upload](images/0*5QltXiQ6vbGzhFM7.jpeg)
![Dialogflow Gateway Service Account upload](images/uploadkeys.png)

Your agent should now appear on the Agents list. To find your connection information and settings, press on the Manage button
Your agent should now appear on the "Agents" list. To find your connection information and settings, press on the "Manage" button

![Dialogflow Gateway Agents](images/0*XTPYBZcSPWM3uhfx.png)

Congratulations! You have successfully connected your Agent to the Gateway.
![Dialogflow Gateway Agents](images/manageagent.png)

If you have any questions or need help to complete these steps, please contact [Google Cloud Support](https://cloud.google.com/support-hub/)

0 comments on commit 26d9311

Please sign in to comment.
You can’t perform that action at this time.