PHP API to interact with Hotel Beds APITUDE, compatible with version 0.2
composer require stayforlong/hotelbeds
"psr-4": {
"StayForLong\\HotelBeds\\": "vendor/stayforlong/hotelbeds/src/"
}
$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/",
];
$api_auth = new ApiAuth($hotel_beds_config['api_key'], $hotel_beds_config['secret']);
https://developer.hotelbeds.com/docs/read/apitude_content/Hotel_Operation
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();
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();
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.
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();