- 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 thetaxiReservation.pickupLocation.address
andtaxiReservation.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
Recommended fields
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 actions.xml
For information about the actions schema, read Create actions.xml.
Handle intent parameters as URL parameters
<?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}">
<!-- Eg. category = "Shared" -->
<!-- (Optional) Require a field eg.category for fulfillment with required="true" -->
<parameter-mapping urlParameter="category" intentParameter="taxiReservation.category" required="true" />
<!-- Eg. pickupLocationName = "Mountain View" -->
<parameter-mapping urlParameter="pickupLocationName" intentParameter="taxiReservation.pickupLocation.name" />
<!-- Eg. dropoffLocationName = "fox theater" -->
<parameter-mapping urlParameter="dropoffLocationName" intentParameter="taxiReservation.dropoffLocation.name" />
<!-- Eg. pickupLocationAddress = "123 Easy Street, Mountain View, CA" -->
<parameter-mapping urlParameter="pickupLocationAddress" intentParameter="taxiReservation.pickupLocation.address" />
<!-- Eg. dropoffLocationAddress = "456 Main Street, Palo Alto" -->
<parameter-mapping urlParameter="dropoffLocationAddress" intentParameter="taxiReservation.dropoffLocation.address" />
<!-- Eg. pickupLocationGeolatitude = "37.3861" -->
<parameter-mapping urlParameter="pickupLocationGeolatitude" intentParameter="taxiReservation.pickupLocation.geo.latitude" />
<!-- Eg. dropoffLocationGeolatitude = "33.7725" -->
<parameter-mapping urlParameter="dropoffLocationGeolatitude" intentParameter="taxiReservation.dropoffLocation.geo.latitude" />
<!-- Eg. pickupLocationGeolongitude = "-122.084" -->
<parameter-mapping urlParameter="pickupLocationGeolongitude" intentParameter="taxiReservation.pickupLocation.geo.longitude" />
<!-- Eg. 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 to guide query matching
taxiReservation.category
is a
field 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>
Derive fulfillment URL using inline inventory
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 to discover URLs for fulfillment
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/.*
.
<?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" } }