Catch up on all the news, sessions, and announcements from Google I/O 2021. Watch now.

Get reservation

Action ID
actions.intent.GET_RESERVATION
Description
View the user's existing reservation. Determine the reservation by the event name and booking time using the reservation.reservationFor.name and reservation.bookingTime intent parameters to present the most relevant ones to the user. Also filter results by the reservation time using the reservation.reservedTime intent parameter, if available.

Locale support

Functionality Locales
Preview creation using App Actions test tool en-US
User invocation from Google Assistant en-US

Example queries

The following fields represent essential information that users often provide in queries that trigger this built-in intent:

reservation.bookingTime
reservation.reservationFor.name

Other supported fields

The following fields represent information that users often provide to disambiguate their needs or otherwise improve their results:

reservation.@type
reservation.reservationFor.@type
reservation.reservedTime

Android Slices

We recommend implementing Android Slices for this built-in intent. An Android Slice presents information or interaction options from your app to improve user engagement in the Google Assistant.

Supported text values by field



Inventory availability by field


Sample XML files

For information about the actions.xml schema, see Create actions.xml. For information about the shortcuts.xml schema, see Create shorcuts.xml.

Handle BII parameters

shortcuts.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample shortcuts.xml -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
  <capability android:name="actions.intent.GET_RESERVATION">
    <intent
      android:action="android.intent.action.VIEW"
      android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
      android:targetClass="YOUR_TARGET_CLASS">
      <!-- Eg. bookingTime = "2011-12-20T23:59:59" -->
      <parameter
        android:name="reservation.bookingTime"
        android:key="bookingTime"/>
      <!-- Eg. reservedTime = "2011-12-21T17:59:59" -->
      <parameter
        android:name="reservation.reservedTime"
        android:key="reservedTime"/>
      <!-- Eg. name = "Example Business Name" -->
      <parameter
        android:name="reservation.reservationFor.name"
        android:key="name"/>
    </intent>
  </capability>
</shortcuts>
      

actions.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
  <action intentName="actions.intent.GET_RESERVATION">
    <fulfillment urlTemplate="myapp://custom-deeplink{?bookingTime,reservedTime,name}">
      <!-- e.g. bookingTime = "2011-12-20T23:59:59" -->
      <!-- (Optional) Require a field eg.bookingTime for fulfillment with required="true" -->
      <parameter-mapping urlParameter="bookingTime" intentParameter="reservation.bookingTime" required="true" />
      <!-- e.g. reservedTime = "2011-12-21T17:59:59" -->
      <parameter-mapping urlParameter="reservedTime" intentParameter="reservation.reservedTime" />
      <!-- e.g. name = "Example Business Name" -->
      <parameter-mapping urlParameter="name" intentParameter="reservation.reservationFor.name" />
    </fulfillment>

    <!-- Provide a fallback fulfillment with no required parameters. For example, to your app search or router deeplink -->
    <fulfillment urlTemplate="myapp://deeplink" />
  </action>
</actions>

Use web inventory

reservation.reservationFor.name is a field that supports web inventory. In the following example, Google Assistant performs a web search for the user query and determines the fulfillment URL. Assistant filters for search results that match the provided urlFilter value of https://www.mywebsite.com/link1/.*.

shortcuts.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample shortcuts.xml -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
  <capability android:name="actions.intent.GET_RESERVATION">
    <intent
      android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
      android:targetClass="YOUR_TARGET_CLASS">
      <parameter
        android:name="reservation.bookingTime"
        android:key="bookingTime"/>
      <parameter
        android:name="reservation.reservedTime"
        android:key="reservedTime"/>
      <parameter
        android:name="reservation.reservationFor.name"
        android:key="name"/>
    </intent>
  </capability>
</shortcuts>
      

actions.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
  <action intentName="actions.intent.GET_RESERVATION">
    <!-- Use URL from entity match for deep link fulfillment -->
    <!-- Example: url = 'https://www.mywebsite.com/link1/item1' -->
    <fulfillment urlTemplate="{@url}" />

    <!-- Provide a fallback fulfillment with no required parameters. For example, to your app search or router deeplink -->
    <fulfillment urlTemplate="myapp://deeplink" />

    <!-- Define parameters with web inventories using urlFilter -->
    <parameter name="reservation.reservationFor.name">
      <entity-set-reference urlFilter="https://www.mywebsite.com/link1/.*" />"/>
    </parameter>
  </action>
</actions>

JSON-LD sample

The following JSON-LD sample provides some example values that you can use in the App Actions test tool:

{
  "@context": "http://schema.googleapis.com",
  "@type": "Reservation",
  "bookingTime": "2011-12-20T23:59:59",
  "reservationFor": {
    "@type": "Thing",
    "name": "Example Business Name"
  },
  "reservedTime": "2011-12-21T17:59:59"
}