Skip to content
Permalink
Browse files

Updated Docs

  • Loading branch information...
mishushakov committed Jul 29, 2019
1 parent e55008a commit 7259a99fcfc62869e3449ab2ae72a5f801771995
Showing with 822 additions and 563 deletions.
  1. +225 βˆ’5 README.md
  2. +0 βˆ’515 guide.md
  3. +9 βˆ’0 hosted/README.md
  4. +48 βˆ’43 { β†’ hosted}/api.md
  5. +141 βˆ’0 hosted/configuration.md
  6. +27 βˆ’0 hosted/faq.md
  7. BIN hosted/images/0*3WG-EcS8ae8H6mYR.png
  8. BIN hosted/images/0*5QltXiQ6vbGzhFM7.jpeg
  9. BIN hosted/images/0*8iYHLAGC8Qc5APhY.png
  10. BIN hosted/images/0*Bw3c0_7Az-MWc4gD.png
  11. BIN hosted/images/0*XTPYBZcSPWM3uhfx.png
  12. BIN hosted/images/0*ZtCBwK0pme7dkEUa.png
  13. BIN hosted/images/1*-AsFIfJ-1TVUZVcPmYrGQg.png
  14. BIN hosted/images/1*0zPrr0SOtY9ulOXmWHhXig.png
  15. BIN hosted/images/1*1P5DjCpGfLWgP6lQpoV7OA.png
  16. BIN hosted/images/1*1mXV-mVBdlEfFbFgxftaNg.png
  17. BIN hosted/images/1*62QR5SouuxZH_n9U9epMkg.png
  18. BIN hosted/images/1*6IQ7e85pPwzec-2xpeJ4pQ.png
  19. BIN hosted/images/1*Kpqq20MfRzHgPRkMbkmADg.png
  20. BIN hosted/images/1*NQdQk2PPVFOrxHa56Q_qqw.png
  21. BIN hosted/images/1*Sax2IOrqX6_09FPS-kqLdA.gif
  22. BIN hosted/images/1*XZEmrPIvovzEsj3ENKx9Fg.png
  23. BIN hosted/images/1*XiohDWc7br_BH_nkjHsLVw.png
  24. BIN hosted/images/1*ZBL4EhjjtVRt__XUWG4kXw.png
  25. BIN hosted/images/1*aKTMHA4wygSZb67T2G3S6w.png
  26. BIN hosted/images/1*bitGmbe8nlnrr4IX0Ipcew.png
  27. BIN hosted/images/1*cP1g1f87V9x7ycNsTf5v1w.png
  28. BIN hosted/images/1*dIvJurZEmgizndXTGdlFBw.png
  29. BIN hosted/images/1*dNrnAw5_fujrbkv9z3PkDQ.png
  30. BIN hosted/images/1*dR5bVY4fUuWwgxEdeeqm_A.png
  31. BIN hosted/images/1*g7d0ZMyE_ODPiwGqalT_wQ.png
  32. BIN hosted/images/1*gzRWa6Edve7C17UzmYQiSA.png
  33. BIN hosted/images/1*mPnKhb4JonFQprSGAMQEXA.png
  34. BIN hosted/images/1*mvXf5JQnhnEtcifBEnG3Qw.png
  35. +61 βˆ’0 hosted/installation.md
  36. +311 βˆ’0 hosted/usage.md
230 README.md
@@ -1,6 +1,226 @@
# Dialogflow Gateway Documents
# Dialogflow Gateway

- [API](api.md)
- [Guide](guide.md)
- [Terms of Service](https://cloud.ushakov.co/tos)
- [Privacy Policy](https://cloud.ushakov.co/privacy)
![](https://svgur.com/i/EHv.svg)

Dialogflow Gateway is a backend enabling third-party integrations to securely access the Dialogflow V2 API. Any server, that implements the API (see below) can be refered as *Dialogflow Gateway*

## Contents

- [API](#api)
- [Response Codes](#response-codes)
- [Errors](#errors)
- [Endpoints](#endpoints)
- [Base Endpoint](#base-endpoint)
- [Base Endpoint Params](#base-endpoint-variables)
- [Base Endpoint Example](#base-endpoint-example)
- [Requests](#requests)
- [Retrieving Agents](#retrieving-agents)
- [Request](#request)
- [Request Variables](#request-variables)
- [Response Body](#response-body)
- [Example Request](#example-request)
- [Example Response](#example-response)
- [Detecting Intents](#detecting-intents)
- [Request](#request-1)
- [Request Variables](#request-variables-1)
- [Request Body](#request-body)
- [Response Body](#response-body-1)
- [Example Request](#example-request-1)
- [Example Response](#example-response-1)
- [Implementations](#implementations)
- [Contact](#contact)

## API

### Response Codes

| HTTP-Code | Reason |
|-----------|------------------------------------------------------------------------|
| 200 | Request was successful |
| 400 | Request Body or Session ID is invalid and/or missing |
| 403 | Integration was blocked or Service Account Key is no longer valid |
| 404 | Integration was not found |
| 500 | Internal Server Error |
| 503 | The service is unavailable |

### Errors

Example JSON response, containing error

```json
{"error": "Could not find your Deployment"}
```

### Endpoints

#### Base Endpoint

Single-Agent scenario

```
https://<PROJECT_ID>.com
```

Multi-Agent scenario using wildcard subdomain

```
https://<PROJECT_ID>.example.com
```

Multi-Agent scenario using path parameter

```
https://example.com/<PROJECT_ID>
```

Multi-Agent scenario using query parameter

```
https://example.com?agent=<PROJECT_ID>
```

#### Base Endpoint Variables

| Variable | Description |
|------------|------------------------------|
| PROJECT_ID | Required, Project Identifier |

#### Base Endpoint Example

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

```
https://dialogflow-web-v2.gateway.dialogflow.cloud.ushakov.co
```

## Requests

#### Retrieving Agents

#### Request

```http
GET <BASE_ENDPOINT>
```

#### Request Variables

| Variable | Description |
|---------------|-----------------------------|
| BASE_ENDPOINT | Required, Endpoint of Agent |

#### Response Body

[Agent](https://cloud.google.com/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.Agent)

#### Example Request

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

```http
GET https://dialogflow-web-v2.gateway.dialogflow.cloud.ushakov.co
```

#### Example Response

```json
{
"parent": "projects/dialogflow-web-v2",
"displayName": "DialogflowWebV2",
"defaultLanguageCode": "en",
"supportedLanguageCodes": [
"ru"
],
"timeZone": "Europe/Madrid",
"description": "This is a unofficial Progressive Web Application for Dialogflow V2, with support for rich-responses and amazing features you need to check out. Choose your language and send Hello to get started",
"avatarUri": "https://storage.googleapis.com/cloudprod-apiai/ce408f19-7966-487d-8614-f5b1f0474ba6_x.png",
"enableLogging": true,
"matchMode": "MATCH_MODE_HYBRID",
"classificationThreshold": 0.3
}
```

### Detecting Intents

#### Request

```http
POST https://<BASE_ENDPOINT>/<SESSION_ID>
```

#### Request Variables

| Variable | Description |
|----------|-------------|
| BASE_ENDPOINT | Required, Endpoint of Agent |
| SESSION_ID | Required. The name of the session this query is sent to. It can be a random number or some type of user identifier. The length of the session ID must not exceed 36 bytes |

#### Request Body

[DetectIntentRequest](https://cloud.google.com/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest)

#### Response Body

[DetectIntentResponse](https://cloud.google.com/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentResponse)

#### Example Request

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

```http
POST https://app-of-the-day-9a9f6.gateway.dialogflow.cloud.ushakov.co/test?format=true
Content-Type: application/json
{
"queryInput": {
"text": {
"text": "Hello",
"languageCode": "en"
}
}
}
```

#### Example Response

```json
{
"responseId": "85c3d6bd-6f8c-4000-a1ec-fdd6f636b2e8",
"queryResult": {
"queryText": "Hello",
"action": "input.welcome",
"parameters": {},
"allRequiredParamsPresent": true,
"fulfillmentText": "Cannot display response in Dialogflow simulator. Please test on the Google Assistant simulator instead.",
"fulfillmentMessages": [...],
"webhookPayload": {...},
"intent": {
"name": "projects/app-of-the-day-9a9f6/agent/intents/1e00bd68-62f0-4b8e-9cdd-a81c19f73855",
"displayName": "Default Welcome Intent"
},
"intentDetectionConfidence": 1,
"diagnosticInfo": {
"end_conversation": true,
"webhook_latency_ms": 187
},
"languageCode": "en"
},
"webhookStatus": {
"message": "Webhook execution successful"
}
}
```

## Implementations

| Title | Developer | Status | Homepage | Features | Cloud-based? |
|-----------------------------------------|-----------|-----------------------------|--------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| Dialogflow Gateway (Hosted) | Ushakov | Stable, actively maintained | https://dialogflow.cloud.ushakov.co | Security Features, API Extensions, 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 |

Submit a PR, if you want to add your implementation to the list!

## Contact

If you have any questions/troubles, regarding the API, please [contact us](https://ushakov.co/#contact)

0 comments on commit 7259a99

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