內容 API 搜尋和回應篩選
輕鬆搜尋和篩選「內容」API 回應以獲得更精準的結果。
合作夥伴可以針對 Rapid「內容」使用搜尋和篩選功能,控制他們在「內容」回應中接收到的旅宿資訊。合作夥伴可藉此簡化來自 Rapid 的資料,僅存取他們需要為旅客提供的資訊,而這意味著降低成本,也更有彈性。
搜尋
搜尋為旅客提供特定設施或服務的旅宿,例如尋找強化永續環保特色的旅宿。
Rapid 合作夥伴可以按以下的旅宿層級元素進行搜尋:
category_id
- 類別all_inclusive
- 全包狀態attribute_id
- 屬性amenity_id
- 物業等級的便利設施spoken_language_id
- 口語
**備註:**此功能不包括特定的客房或房價計畫元素。
Rapid 3 請求範例:
在此範例中,我們使用新的 amenity_id
搜尋參數來限制傳回的屬性。
curl -X GET "https://test.ean.com/v3/properties/content\
?language=en-US\
&supply_source=expedia\
&amenity_id=115\
&include=property_id\
&property_id=1337\
&property_id=1" \
-H "accept: application/json, application/json"\
-H "accept-encoding: gzip"\
-H "authorization: EAN apikey=abcd1234,signature=090a77e7ddd7779980231,timestamp=1697664047"\
-H "user-agent: TravelNow/3.30.112"
快速 3 響應範例:
在此回應中,我們可以看到僅傳回了屬性 1337,因為屬性 1 沒有可用的便利設施 ID 115 。
{
"1337": {
"property_id": "1337"
}
}
有關可用的屬性、設施服務、交談語言和類別的完整清單,請參閱「內容參考清單」。
篩選
要求部分的 Rapid「內容」回應,不需接收完整的旅宿詳情。合作夥伴可以僅要求所需「內容」API 回應的頂層區段。這可以透過 include
參數進行要求,而結果將僅包含每間旅宿的 property_id
和要求的區段。
目前可用於篩選的區段包括以下各項。
**備註:**以下並非完整的清單,因為篩選功能也將適用於未來新加入的任何頂層區段。
property_id
name
address
ratings
location
phone
fax
category
rank
business_model
checkin
checkout
fees
policies
attributes
amenities
images
onsite_payments
rooms
rates
dates
descriptions
statistics
airports
themes
all_inclusive
tax_id
chain
brand
spoken_languages
multi_unit
payment_registration_recommended
supply_source
vacation_rental_details
Rapid 3 請求範例:
在此範例中,我們在 name
參數中使用 amenities
和 include
值。
curl -X GET "https://test.ean.com/v3/properties/content\
?language=en-US\
&supply_source=expedia\
&include=name\
&include=amenities\
&property_id=1337" \
-H "accept: application/json, application/json"\
-H "accept-encoding: gzip"\
-H "authorization: EAN apikey=abcd1234,signature=090a77e7ddd7779980231,timestamp=1697664047"\
-H "user-agent: TravelNow/3.30.112"
快速 3 響應範例:
在這裡我們可以看到回應中包含 property_id
、name
和 amenities
。 property_id
始終包含在回應中,並且不需要指定為 include
請求參數,除非它是回應中所需的唯一欄位。注意:為了使範例簡潔,便利設施清單已被截斷。
{
"1337": {
"property_id": "1337",
"name": "Hyatt Regency Paris Etoile",
"amenities": {
"8": {
"id": "8",
"name": "Elevator"
},
"43": {
"id": "43",
"name": "Concierge services"
},
"115": {
"id": "115",
"name": "Bicycle rentals nearby"
},
"361": {
"id": "361",
"name": "Breakfast available (surcharge)"
},
...
}
}
}