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

Actions

Actions are entry points into your app that define the invocation and discovery model for your app. You declare actions in a JSON file called an action package, which you eventually upload to your developer project when you want to test or submit your app for approval.

Defining actions

Every app must define one and only one default action that declares support for the actions.intent.MAIN intent. This intent is triggered whenever users invoke your app by its name, such as "Ok Google, talk to Sekai".

You can create additional actions in your action package with intents that you define yourself. These intents trigger "deep-link" actions in your app, allowing users to invoke specific functionality, such as "Ok Google, talk to Sekai to find some sneakers".

The following example shows how you might declare these actions:

{
  "actions": [
    {
     "name": "MAIN",
     "intent": {
          "name": "actions.intent.MAIN"
     },
     "fulfillment": {
        conversationName: "sekai-app"
      }
    },
    {
      "name": "BUY",
      "intent": {
        "name": "com.example.sekai.BUY",
        "parameters": [{
          "name": "color",
          "type": "SchemaOrg_Color"
        }],
        "trigger": {
          "queryPatterns": [
            {"queryPattern": "find some $SchemaOrg_Color:color sneakers"},
            {"queryPattern": "buy some blue suede shoes"},
            {"queryPattern": "get running shoes" }
          ]
        }
      },
      "fulfillment": {
        conversationName: "sekai-app"
      }
    }
  ],
  "conversations": {
    "sekai-app": {
      "name": "sekai-app",
      "url": "https://sekai.example.com/sekai-app"
    }
  }
}