Migration from Demand API Guide V2
This page summarizes the main differences in architecture, design, and functionality between the Demand API V2 and the Connect API. Read this topic to help plan your migration.
Authentication
In Connect API, each call to endpoints must identify an API user that is authorised to access that endpoint (Identify the API user in a request)
To enable an API user to access the Connect API, you must do the following:
- Authenticate the API key to get an access token
- Include your access token and the appropriate account id in the header of every request.
The API key is an HTTP bearer token. Bearer tokens provide greater security than the Basic authentication method used in Demand API V2.
For more information, see Authentication and authorization.
Endpoint structure
The following table compares the structure of Demand API V2 and Connect API endpoints.
Demand API V2 | Connect API Demand API V2 Compatible | |
---|---|---|
Protocol | https | https |
Base URL - production | distribution-xml.booking.com/2.*/ | metasearch-connect-api.booking.com/demand-api-v2-compatible/ |
Authentication | Basic Authentication | Bearer Token |
An example mapping
V2
GET https://distribution-xml.booking.com/2.10/hotelAvailability? city_ids=-2140479 &guest_country="nl" &room1="A,A" &checkin="2023-08-15" &checkout="2023-08-16"
Connect API
GET https://metasearch-connect-api.booking.com/demand-api-v2-compatible/hotelAvailability? city_ids=-2140479 &guest_country="nl" &room1="A,A" &checkin="2023-08-15" &checkout="2023-08-16"
Accept Header
Provide a valid Accept header value based on API documentation. See Demand API V2 compatible endpoints and Demand API V3 compatible endpoints for more information.
Errors
The page Error handling describes what errors can occur when calling Connect API endpoints and what you should do to avoid or fix them. You should update your error handling code in line with the guidance and information given there.