- Action ID
actions.intent.CREATE_LODGING_RESERVATION
- Description
-
Search for available hotel or other lodging reservations in an app. Populate the search criteria using the details that best match your app's search functionality. For example, you can populate the address using the
lodgingReservation.reservationFor.address
intent parameter and (if available) the check-in time withlodgingReservation.reservationFor.checkinTime
. Filter available reservations using information from thelodgingReservation.reservationFor.description
parameter, if available.If enough fields are populated to perform a search, your app can directly show search results. Your app must confirm with the user before creating a reservation.
.
Locale support
Functionality | Locales |
---|---|
Preview creation using App Actions test tool | en-US |
User invocation from Google Assistant | en-US |
Example queries
Recommended fields
The following fields represent essential information that users often provide in queries that trigger this built-in intent:
lodgingReservation.reservationFor.address
lodgingReservation.reservationFor.brand.name
Other supported fields
The following fields represent information that users often provide to disambiguate their needs or otherwise improve their results:
lodgingReservation.@type
lodgingReservation.reservationFor.@type
lodgingReservation.reservationFor.brand.@type
lodgingReservation.reservationFor.checkinTime
lodgingReservation.reservationFor.description
Supported text values by field
Inventory availability by field
Sample XML files
For information about the shortcuts.xml
schema, see Create shortcuts.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_LODGING_RESERVATION">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
android:targetClass="YOUR_TARGET_CLASS">
<!-- Eg. address = "123 Main Street, San Francisco, CA 12345" -->
<parameter
android:name="lodgingReservation.reservationFor.address"
android:key="address"/>
<!-- Eg. checkinTime = "2011-12-20T23:59:59" -->
<parameter
android:name="lodgingReservation.reservationFor.checkinTime"
android:key="checkinTime"/>
<!-- Eg. description = "hostel" -->
<parameter
android:name="lodgingReservation.reservationFor.description"
android:key="description"/>
<!-- Eg. name = "Example Hotel Chain" -->
<parameter
android:name="lodgingReservation.reservationFor.brand.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.CREATE_LODGING_RESERVATION">
<fulfillment urlTemplate="myapp://custom-deeplink{?address,checkinTime,description,name}">
<!-- e.g. address = "123 Main Street, San Francisco, CA 12345" -->
<!-- (Optional) Require a field eg.address for fulfillment with required="true" -->
<parameter-mapping urlParameter="address" intentParameter="lodgingReservation.reservationFor.address" required="true" />
<!-- e.g. checkinTime = "2011-12-20T23:59:59" -->
<parameter-mapping urlParameter="checkinTime" intentParameter="lodgingReservation.reservationFor.checkinTime" />
<!-- e.g. description = "hostel" -->
<parameter-mapping urlParameter="description" intentParameter="lodgingReservation.reservationFor.description" />
<!-- e.g. name = "Example Hotel Chain" -->
<parameter-mapping urlParameter="name" intentParameter="lodgingReservation.reservationFor.brand.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
lodgingReservation.reservationFor.address
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_LODGING_RESERVATION">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
android:targetClass="YOUR_TARGET_CLASS">
<parameter android:name="lodgingReservation.reservationFor.address">
<data android:pathPattern="https://www.mywebsite.com/link1/.*"/>
</parameter>
<parameter android:name="lodgingReservation.reservationFor.checkinTime">
<data android:pathPattern="https://www.mywebsite.com/link2/.*"/>
</parameter>
<parameter android:name="lodgingReservation.reservationFor.description">
<data android:pathPattern="https://www.mywebsite.com/link3/.*"/>
</parameter>
<parameter android:name="lodgingReservation.reservationFor.brand.name">
<data android:pathPattern="https://www.mywebsite.com/link4/.*"/>
</parameter>
</intent>
</capability>
</shortcuts>
actions.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.CREATE_LODGING_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="lodgingReservation.reservationFor.address">
<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.org", "@type": "LodgingReservation", "reservationFor": { "@type": "Hotel", "address": "123 Main Street, San Francisco, CA 12345", "brand": { "@type": "Brand", "name": "Example Hotel Chain" }, "checkinTime": "2011-12-20T23:59:59", "description": "hostel" } }