Deploy a Google Actions Endpoint

Description

With the implementation of a Google Actions Endpoint you can easily connect your Google App with COGNIGY.AI.

This tutorial covers the necessary steps for creating and connecting a Google Actions Endpoint. If you want to get information about assigning a Flow to the Endpoint and setting up the Data Management see Endpoints.

Two Step Preparation Process

1 Create a Google App on Actions on Google
2 Create and Configure a Google Actions Endpoint on COGNIGY.AI

1 Create a Google App

:link: On Actions on Google

Requirements
Google Account
gactions CLI (see here)

1.1 Go to the Actions Console


On the Actions on Google page log into your Google Account and click then on the button in the upper right corner to open the Actions Console (see figure 1.1).

18941894

Figure 1.1: Button to navigate to the Actions Console

1.2 Create a Project


If not done yet, create a new project for the endpoint (see figure 1.2).

548548

Figure 1.2: Prompt for creating a Project

1.3 Select Custom as Option


You are on the overview page for selecting a category for your project (after creating a project). Select the Custom option (see figure 1.3).

10271027

Figure 1.3: Custom Action Option

1.4 Select Blank Project

After creating a Custom action, you will be asked to select a project template. In order to connect the Google Action to Cognigy, we start with a Blank project. Thus, please select the Blank project option (see figure 1.4).

10201020

Figure 1.4: New Blank Project

1.5 Enter the Information for the Google App


You have to enter all the necessary information if you want to test and use your Google App. Go to the overview page of your Google App (see figure 1.5) and enter information like the description, invocation name, and so on.

12791279

Figure 1.5: Google App Overview

2 Create and Configure a Google Actions Endpoint

:link: On COGNIGY.AI

2.1 Create a Google Actions Enpoint


First you have to create an Endpoint of the type Google Actions (see figure 2.1).

602602

Figure 3.1: Google Actions Endpoint Creation

2.2 Get the Endpoint URL


Move to the top of the Endpoint Configuration page and copy the Endpoint URL which is displayed above the General Settings (see figure 2.2).

15341534

Figure 2.2: Endpoint URL

3 Final Step: Connect Your Google Actions App to the Endpoint

:link: Via gactions CLI

Requirements
Endpoint URL
Update Command (see step 1.4)

Copy the following code snippet and paste it into a file called action.en.json:

{
  "locale": "en",
    "actions": [{
      "description": "Default Welcome Intent",
      "name": "MAIN",
      "fulfillment": {
        "conversationName": "connectToCognigy"
      },
      "intent": {
        "name": "actions.intent.MAIN"
      }
    }],
    "conversations": {
      "connectToCognigy": {
        "name": "connectToCognigy",
        "url": "https://endpoint-dev.cognigy.com/d279b53f72abc25dc93506afb3b09ce60b7bb66128b160bd7ab16915063aafe9",
        "inDialogIntents": [
          {
            "name": "actions.intent.CANCEL"
          }
      ]
    }
  }
}

🚧

Locales

You need to change the 'locale' setting at the top of the JSON object in case you want to publish an action in another language than English. See below

Change the value for the url field to the Endpoint URL gathered in step 2.2. Save the file as a JSON-file (see figure 3.1).

11321132

Figure 3.1: Google Actions Configuration

Next open a Terminal (Windows: Command Prompt) and enter the update command.

gactions update --action_package PACKAGE_NAME --project PROJECT_ID

Edit the command by changing the PACKAGE_NAME parameter to the path of the previously saved JSON-file and the PROJECT_ID for the Project ID of your project. YOu can find the project ID under "Project Settings"

18961896

Figure 3.2: Project ID

Execute the command.

gactions update --action_package action.en.json --project projectid

You should be all set up to use the Google Actions Endpoint you've created with a Flow of your choice.

4 Testing your Google Actions Endpoint

To test your Google Actions Endpoint, you can go to the Simulator in the Google Actions Console. Here you can invoke your Google App with the name you chose, and the message will be sent to your Flow. In the right panel, you can see how any rich content such as cards would be rendered on a Phone.

19061906

Figure 4.1: The Google Actions Simulator

🚧

Functionality

Before you start testing the Google Actions Endpoint with your own actions, you should read the design guidelines in case you are going to add some rich content
:link: On Rich responses

Not following certain requirements can result in the Google Actions not working properly.

🚧

Permissions

You need to give certain permissions in your Google Account in order to use the Simulator. If the Simulator doesn't work for you this can be the issue. The easiest way to grant these permissions is by invoking your Google App from the Google Assistant on your Device (e.g. Phone or Google Home).


Did this page help you?