Join the Actions on Google Developer Challenge to win a trip to Google I/O 2018 and more than 20 other prizes.

Create a project and action package

Create a project

  1. Go to the Actions on Google Developer Console.
  2. Click on Add Project, enter name for the project, and click Create Project.
  3. In the Overview screen, click on Use Actions SDK, and make note of the gactions command. You'll need to use this command when uploading your action package for approval.

gactions update --action_package PACKAGE_NAME --project PROJECT_NAME

Create an action package

Action packages are JSON files that define the actions in your app. Actions map an intent to fulfill with the actual fulfillment endpoint.

  1. Download the gactions CLI.
  2. Create a local directory for your app's source files. We'll refer to this directory as <project-dir>.
  3. Run the following commands to create a boilerplate action package file named action.json:

    cd <project-dir>
    gactions init
    

    The file looks like this:

    {
        "actions": [
          {
            "description": "Default Welcome Intent",
            "name": "MAIN",
            "fulfillment": {
              "conversationName": "<INSERT YOUR CONVERSATION NAME HERE>"
            },
            "intent": {
              "name": "actions.intent.MAIN",
              "trigger": {
                "queryPatterns": [
                  "talk to <INSERT YOUR NAME HERE>"
                ]
              }
            }
          }
        ],
        "conversations": {
          "<INSERT YOUR CONVERSATION NAME HERE>": {
            "name": "<INSERT YOUR CONVERSATION NAME HERE>",
            "url": "<INSERT YOUR FULLFILLMENT URL HERE>"
          }
        }
    }
    

In the next section, you'll learn how to define actions in the action package.