Create taxi reservation

Action ID
actions.intent.CREATE_TAXI_RESERVATION
Description

Construct a new request to reserve a taxi or ride. Populate the destination using the taxiReservation.dropoffLocation.name intent parameter. Populate the origin and ride type (like "carpool" or "peer-to-peer") using the taxiReservation.pickupLocation.address and taxiReservation.category intent parameters, if available.

Your app must confirm with the user before booking the reservation.

Locale support

Functionality Locales
Preview creation using App Actions test tool en-US, en-GB, en-CA, en-IN, en-BE, en-SG, en-AU, id-ID
User invocation from Google Assistant en-US, en-GB, en-CA, en-IN, en-BE, en-SG, en-AU, id-ID

Example queries

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

taxiReservation.dropoffLocation.name

Other supported fields

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

taxiReservation.@type
taxiReservation.category
taxiReservation.dropoffLocation.@type
taxiReservation.dropoffLocation.address
taxiReservation.dropoffLocation.geo.@type
taxiReservation.dropoffLocation.geo.latitude
taxiReservation.dropoffLocation.geo.longitude
taxiReservation.pickupLocation.@type
taxiReservation.pickupLocation.address
taxiReservation.pickupLocation.geo.@type
taxiReservation.pickupLocation.geo.latitude
taxiReservation.pickupLocation.geo.longitude
taxiReservation.pickupLocation.name

Supported text values by field






Inventory availability by field




Foreground app invocation

This built-in intent supports foreground app invocation.

Functionality Locales
Preview creation using App Actions test tool en-US, en-GB, en-CA, en-IN, en-BE, en-SG, en-AU
User invocation from Google Assistant en-US, en-GB, en-CA, en-IN, en-BE, en-SG, en-AU

The following example queries are specific to intent matching for foreground app invocation:

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.CREATE_TAXI_RESERVATION">
    <intent
      android:action="android.intent.action.VIEW"
      android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
      android:targetClass="YOUR_TARGET_CLASS">
      <!-- Eg. category = "Shared" -->
      <parameter
        android:name="taxiReservation.category"
        android:key="category"/>
      <!-- Eg. pickupLocationName = "Mountain View" -->
      <parameter
        android:name="taxiReservation.pickupLocation.name"
        android:key="pickupLocationName"/>
      <!-- Eg. dropoffLocationName = "fox theater" -->
      <parameter
        android:name="taxiReservation.dropoffLocation.name"
        android:key="dropoffLocationName"/>
      <!-- Eg. pickupLocationAddress = "123 Easy Street, Mountain View, CA" -->
      <parameter
        android:name="taxiReservation.pickupLocation.address"
        android:key="pickupLocationAddress"/>
      <!-- Eg. dropoffLocationAddress = "456 Main Street, Palo Alto" -->
      <parameter
        android:name="taxiReservation.dropoffLocation.address"
        android:key="dropoffLocationAddress"/>
      <!-- Eg. pickupLocationGeolatitude = "37.3861" -->
      <parameter
        android:name="taxiReservation.pickupLocation.geo.latitude"
        android:key="pickupLocationGeolatitude"/>
      <!-- Eg. dropoffLocationGeolatitude = "33.7725" -->
      <parameter
        android:name="taxiReservation.dropoffLocation.geo.latitude"
        android:key="dropoffLocationGeolatitude"/>
      <!-- Eg. pickupLocationGeolongitude = "-122.084" -->
      <parameter
        android:name="taxiReservation.pickupLocation.geo.longitude"
        android:key="pickupLocationGeolongitude"/>
      <!-- Eg. dropoffLocationGeolongitude = "-84.3858" -->
      <parameter
        android:name="taxiReservation.dropoffLocation.geo.longitude"
        android:key="dropoffLocationGeolongitude"/>
    </intent>
  </capability>
</shortcuts>
      

actions.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
  <action intentName="actions.intent.CREATE_TAXI_RESERVATION">
    <fulfillment urlTemplate="myapp://custom-deeplink{?category,pickupLocationName,dropoffLocationName,pickupLocationAddress,dropoffLocationAddress,pickupLocationGeolatitude,dropoffLocationGeolatitude,pickupLocationGeolongitude,dropoffLocationGeolongitude}">
      <!-- e.g. category = "Shared" -->
      <!-- (Optional) Require a field eg.category for fulfillment with required="true" -->
      <parameter-mapping urlParameter="category" intentParameter="taxiReservation.category" required="true" />
      <!-- e.g. pickupLocationName = "Mountain View" -->
      <parameter-mapping urlParameter="pickupLocationName" intentParameter="taxiReservation.pickupLocation.name" />
      <!-- e.g. dropoffLocationName = "fox theater" -->
      <parameter-mapping urlParameter="dropoffLocationName" intentParameter="taxiReservation.dropoffLocation.name" />
      <!-- e.g. pickupLocationAddress = "123 Easy Street, Mountain View, CA" -->
      <parameter-mapping urlParameter="pickupLocationAddress" intentParameter="taxiReservation.pickupLocation.address" />
      <!-- e.g. dropoffLocationAddress = "456 Main Street, Palo Alto" -->
      <parameter-mapping urlParameter="dropoffLocationAddress" intentParameter="taxiReservation.dropoffLocation.address" />
      <!-- e.g. pickupLocationGeolatitude = "37.3861" -->
      <parameter-mapping urlParameter="pickupLocationGeolatitude" intentParameter="taxiReservation.pickupLocation.geo.latitude" />
      <!-- e.g. dropoffLocationGeolatitude = "33.7725" -->
      <parameter-mapping urlParameter="dropoffLocationGeolatitude" intentParameter="taxiReservation.dropoffLocation.geo.latitude" />
      <!-- e.g. pickupLocationGeolongitude = "-122.084" -->
      <parameter-mapping urlParameter="pickupLocationGeolongitude" intentParameter="taxiReservation.pickupLocation.geo.longitude" />
      <!-- e.g. dropoffLocationGeolongitude = "-84.3858" -->
      <parameter-mapping urlParameter="dropoffLocationGeolongitude" intentParameter="taxiReservation.dropoffLocation.geo.longitude" />
    </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 inline inventory

shortcuts.xml

taxiReservation.category is an intent parameter that supports inline inventory. By defining a <shortcut> for taxiReservation.category, you can uniquely identify entities that are of interest to your app or restrict fulfillment to the set of supported entities.

In the following example, when the user query matches the category_one shortcut, Assistant provides the associated shorcut identifier, ID_ONE, as the URL parameter category to fulfillment.

If there is no inventory match, the text value received in the query for taxiReservation.category is passed as-is.

<?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.CREATE_TAXI_RESERVATION">
    <intent
      android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
      android:targetClass="YOUR_TARGET_CLASS">
      <parameter
        android:name="taxiReservation.category"
        android:key="category"/>
      <parameter
        android:name="taxiReservation.pickupLocation.name"
        android:key="pickupLocationName"/>
      <parameter
        android:name="taxiReservation.dropoffLocation.name"
        android:key="dropoffLocationName"/>
      <parameter
        android:name="taxiReservation.pickupLocation.address"
        android:key="pickupLocationAddress"/>
      <parameter
        android:name="taxiReservation.dropoffLocation.address"
        android:key="dropoffLocationAddress"/>
      <parameter
        android:name="taxiReservation.pickupLocation.geo.latitude"
        android:key="pickupLocationGeolatitude"/>
      <parameter
        android:name="taxiReservation.dropoffLocation.geo.latitude"
        android:key="dropoffLocationGeolatitude"/>
      <parameter
        android:name="taxiReservation.pickupLocation.geo.longitude"
        android:key="pickupLocationGeolongitude"/>
      <parameter
        android:name="taxiReservation.dropoffLocation.geo.longitude"
        android:key="dropoffLocationGeolongitude"/>
    </intent>
    </capability>
    <!-- Short and long labels must be @string resource. -->
    <shortcut
      android:shortcutId="ID_ONE"
      android:shortcutShortLabel="@string/shortcut_short_label"
      android:shortcutLongLabel="@string/shortcut_long_label">
      <capability-binding android:key="actions.intent.CREATE_TAXI_RESERVATION">
        <parameter-binding
          android:value="category"
          android:key="taxiReservation.category"/>
      </capability-binding>
    </shortcut>
</shortcuts>
      

actions.xml

taxiReservation.category is an intent parameter that supports inline inventory. By defining an <entity-set> for taxiReservation.category, you can uniquely identify entities that are of interest to your app or restrict fulfillment to the set of supported entities.

In the following example, when the user query matches the category_one entity, Assistant provides the associated identifier, ID_ONE, as the URL parameter category to fulfillment.

If there is no inventory match, the text value received in the query for taxiReservation.category is passed as-is.

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
  <action intentName="actions.intent.CREATE_TAXI_RESERVATION">
    <fulfillment urlTemplate="myapp://deeplink{?category}" >
      <!-- category = "ID_ONE" or "ID_TWO"  -->
      <!-- If no inventory match, category is a text value, such as "Shared" -->
      <!-- (Optional) Use entityMatchRequired="true" to require inventory match for fulfillment -->
      <parameter-mapping urlParameter="category" intentParameter="taxiReservation.category" />
    </fulfillment>

    <!-- Define parameters with inventories here -->
    <parameter name="taxiReservation.category">
      <entity-set-reference entitySetId="categoryEntitySet"/>
    </parameter>
  </action>

  <entity-set entitySetId="categoryEntitySet">
  <!-- Provide an identifier per entity -->
    <entity identifier="ID_ONE" name="category_one" alternateName="@array/category_one_synonyms"/>
    <entity identifier="ID_TWO" name="category_two" alternateName="@array/category_two_synonyms"/>
  </entity-set>
</actions>

The url attribute associated with the entity can be used to determine the fulfillment URL if there is an inventory match. In the following example, when the user query matches the category_one entity, Assistant provides myapp://deeplink/one as the fulfillment URL.

  <?xml version="1.0" encoding="utf-8"?>
  <!-- This is a sample actions.xml -->
  <actions>
    <action intentName="actions.intent.CREATE_TAXI_RESERVATION">
      <!-- Use url from inventory match for deep link fulfillment -->
      <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 inventories here -->
      <parameter name="taxiReservation.category">
        <entity-set-reference entitySetId="categoryEntitySet"/>
      </parameter>
    </action>

    <entity-set entitySetId="categoryEntitySet">
      <!-- Provide a URL per entity -->
      <entity url="myapp://deeplink/one" name="category_one" alternateName="@array/category_one_synonyms"/>
      <entity url="myapp://deeplink/two" name="category_two" alternateName="@array/category_two_synonyms"/>
    </entity-set>
  </actions>
  

Use web inventory

taxiReservation.pickupLocation.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.CREATE_TAXI_RESERVATION">
    <intent
      android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
      android:targetClass="YOUR_TARGET_CLASS">
      <parameter
        android:name="taxiReservation.category"
        android:key="category"/>
      <parameter
        android:name="taxiReservation.pickupLocation.name"
        android:key="pickupLocationName"/>
      <parameter
        android:name="taxiReservation.dropoffLocation.name"
        android:key="dropoffLocationName"/>
      <parameter
        android:name="taxiReservation.pickupLocation.address"
        android:key="pickupLocationAddress"/>
      <parameter
        android:name="taxiReservation.dropoffLocation.address"
        android:key="dropoffLocationAddress"/>
      <parameter
        android:name="taxiReservation.pickupLocation.geo.latitude"
        android:key="pickupLocationGeolatitude"/>
      <parameter
        android:name="taxiReservation.dropoffLocation.geo.latitude"
        android:key="dropoffLocationGeolatitude"/>
      <parameter
        android:name="taxiReservation.pickupLocation.geo.longitude"
        android:key="pickupLocationGeolongitude"/>
      <parameter
        android:name="taxiReservation.dropoffLocation.geo.longitude"
        android:key="dropoffLocationGeolongitude"/>
    </intent>
  </capability>
</shortcuts>
      

actions.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
  <action intentName="actions.intent.CREATE_TAXI_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="taxiReservation.pickupLocation.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": "TaxiReservation",
  "category": "Shared",
  "dropoffLocation": {
    "@type": "Place",
    "address": "456 Main Street, Palo Alto",
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": "33.7725",
      "longitude": "-84.3858"
    },
    "name": "fox theater"
  },
  "pickupLocation": {
    "@type": "Place",
    "address": "123 Easy Street, Mountain View, CA",
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": "37.3861",
      "longitude": "-122.084"
    },
    "name": "Mountain View"
  }
}