BOOKINGAPI is designed to book hotels in real time as fast as in two steps. It covers the complete booking process; it allows generating lists of hotels, confirming bookings, getting lists of bookings, obtaining booking information, making cancellations and modify existing bookings. BOOKINGAPI works in combination with CONTENTAPI to obtain content information from the hotels, such as pictures, description, facilities, services, etc. Please refer to the ContentAPI documentation and IO/DOCS for related information. BOOKINGAPI has been designed for a two steps confirmation, but due the the complexity of client and providers systems a third method has been designed.
This Python package is automatically generated by the Swagger Codegen project:
- API version: 1.0
- Package version: 1.0.0
- For more information, please visit https://developer.hotelbeds.com
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
For python 2
sudo pip2.7 install git+https://github.com/vmavromatis/hotel-api-sdk-python.git --upgrade
For python 3
sudo pip install git+https://github.com/vmavromatis/hotel-api-sdk-python.git --upgrade
(you may need to run pip
with root permission: sudo pip install git+https://github.com//.git
)
Then import the package:
import bookingapi
Please follow the installation procedure and then run the following to make a status request:
from __future__ import print_function
import time, hashlib
import bookingapi
from bookingapi.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = bookingapi.StatusApi()
version = '1.0' # str | Default version for this operation
# Your API Key and secret
apiKey = "xxxxxxxxxxxxxxxxxxxxxxx"
Secret = "xxxxxxxxxx"
# Signature is generated by SHA256 (Api-Key + Secret + Timestamp (in seconds))
sigStr = "%s%s%d" % (apiKey, Secret, int(time.time()))
signature = hashlib.sha256(sigStr).hexdigest()
api_instance.api_client.set_default_header('api-key', apiKey)
api_instance.api_client.set_default_header('x-signature', signature)
try:
# Status check
api_response = api_instance.status(version)
pprint(api_response)
except ApiException as e:
print("Exception when calling StatusApi->status: %s\n" % e)
Refer to the wiki page for a basic workfow
All URIs are relative to https://api.test.hotelbeds.com/hotel-api
Class | Method | HTTP request | Description |
---|---|---|---|
BookingsApi | booking | POST /{version}/bookings | Booking confirm |
BookingsApi | booking_cancellation | DELETE /{version}/bookings/{bookingId} | Booking cancellation |
BookingsApi | booking_change | PUT /{version}/bookings/{bookingId} | Booking change |
BookingsApi | booking_detail | GET /{version}/bookings/{bookingId} | Booking detail |
CheckratesApi | check_rate | POST /{version}/checkrates | Check Availability Rates |
HotelsApi | availability | POST /{version}/hotels | Hotel availability |
StatusApi | status | GET /{version}/status | Check API status |
- ApiAuditData
- ApiBillingAddress
- ApiBoards
- ApiBooking
- ApiBookingDevice
- ApiBookingRoom
- ApiBookings
- ApiCancellationPolicy
- ApiCost
- ApiCreditCard
- ApiDailyRate
- ApiDestination
- ApiError
- ApiFilter
- ApiGeoLocation
- ApiHolder
- ApiHotel
- ApiHotels
- ApiHotelsFilter
- ApiKeyword
- ApiKeywordsFilter
- ApiModificationPolicies
- ApiOccupancy
- ApiOffer
- ApiPax
- ApiPaymentCard
- ApiPaymentContactData
- ApiPaymentData
- ApiPromotion
- ApiRate
- ApiRateBreakDown
- ApiRateDiscount
- ApiRateSupplement
- ApiReview
- ApiReviewFilter
- ApiRooms
- ApiShiftRate
- ApiSource
- ApiStay
- ApiSupplier
- ApiTax
- ApiTaxes
- ApiUpselling
- ApiVoucher
- ApiVoucherComment
- ApiVoucherEmail
- AvailabilityRQ
- AvailabilityRS
- BookingCancellationRS
- BookingChangeRQ
- BookingChangeRS
- BookingDetailRS
- BookingListRS
- BookingRQ
- BookingRS
- CheckRateRQ
- CheckRateRS
- Room
- StatusRS
# Your API Key and secret
apiKey = "xxxxxxxxxxxxxxxxxxxxxxx"
Secret = "xxxxxxxxxx"
# Signature is generated by SHA256 (Api-Key + Secret + Timestamp (in seconds))
sigStr = "%s%s%d" % (apiKey, Secret, int(time.time()))
signature = hashlib.sha256(sigStr).hexdigest()
api_instance.api_client.set_default_header('api-key', apiKey)
api_instance.api_client.set_default_header('x-signature', signature)
More info at https://developer.hotelbeds.com/docs/read/Home#authentication