stayforlong/hotelbeds
Composer 安装命令:
composer require stayforlong/hotelbeds
包简介
To use the differents services from Hotel Beds. Compatible with version 0.2
README 文档
README
PHP API to interact with Hotel Beds APITUDE, compatible with version 1.0
Instalation
composer require stayforlong/hotelbeds
composer.json
"psr-4": {
"StayForLong\\HotelBeds\\": "vendor/stayforlong/hotelbeds/src/"
}
Configuration:
$hotel_beds_config = [
'api_key' => '{YOUR_API_KEY}',
'secret' => '{YOUR_SECRET}',
'url_content' => "https://api.test.hotelbeds.com/hotel-content-api/0.2/",
'url_hotels' => "https://api.test.hotelbeds.com/hotel-api/0.2/",
];
Authentification:
$api_auth = new ApiAuth($hotel_beds_config['api_key'], $hotel_beds_config['secret']);
Services Content
Hotels
https://developer.hotelbeds.com/docs/read/apitude_content/Hotel_Operation
Examples
Hotels list form PMI:
$api_params = [
"fields" => "all",
"destinationCode" => "PMI",
"language" => "ENG",
"from" => 1,
"to" => 20,
];
$request = new ServiceRequest($api_auth, $hotel_beds_config['url_content'], $api_params);
$service_hotels_list = new ServiceHotelsList($request);
$response = $service_hotels_list();
Locations
https://developer.hotelbeds.com/docs/read/apitude_content/location_operations
- Country Operations: it will return the list of available countries.
- Destinations Operations: it will return the list of available destinations, zones and grouping zones.
Locations Destinations:
$api_params = [
"fields" => "name,description,countryCode,destinationCode",
"destinationCode" => "ES",
"language" => "ENG",
"from" => 1,
"to" => 10,
];
$request = new ServiceRequest($api_auth, $hotel_beds_config['url_content'], $api_params);
$service_locations_list = new ServiceTypesList($request);
$response = $service_locations_list();
Types
https://developer.hotelbeds.com/docs/read/apitude_content/types_operations
- Accommodations Operation: it will return the list of available accommodation types.
- Boards Operation: it will return the list of available board types.
- Categories Operation: it will return the list of available Categories.
- Chains Operation: it will return the list of available Chains.
- Currencies Operation: it will return the list of available Currencies.
- Facilities Operation: it will return the list of available Facilities.
- Facilitygroups Operation: it will return the list of available Facilitygroups.
- Facilitytypologies Operation: it will return the list of available Facilitytypologies.
- Issues Operation: it will return the list of available Issues.
- Languages Operation: it will return the list of available Languages.
- Promotions Operation: it will return the list of available Promotions.
- Rooms Operation: it will return the list of available Rooms.
- Segments Operation: it will return the list of available Segments.
- Terminals Operation: it will return the list of available Terminals.
- Image Types Operation: it will return the descriptions of the different image types.
- Category Groups Operation: it will return the descriptions of the different category groups.
- Rate Comments Operation: it will return the descriptions of the rate comments associated to the hotel that the hotelier wants the client to know before confirming the booking.
Examples
Types Facilities:
$api_params = [
"fields" => "all",
"language" => "ENG",
"from" => 1,
"to" => 100,
];
$request = new ServiceRequest($api_auth, $hotel_beds_config['url_content'], $api_params);
$service_types_list = new ServiceTypesList($request);
$response = $service_types_list();
统计信息
- 总下载量: 9.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-29