Asynchronous Search API
The Asynchronous Search API flow is useful for implementing a polling results behavior commonly seen on B2C websites. This flow keeps the end consumer engaged by displaying rates as received by the suppliers; with the async API, the search becomes as fast as your fastest supplier.
The complete Asynchronous Search API flow consists of three main APIs:
- Search Init: Initiates the search process.
- Search Results: Retrieves the initial set of search results.
- Search Results Polling: Continuously polls for the next set of results, updating the user with new data as it becomes available.
Search Init details:
HTTP: POST
Endpoint:{baseEndpoint}/api/hotel/availability/init
Search Result details::
HTTP: GET
Endpoint:{baseEndpoint}/api/hotel/availability/async/{token}/results
Search Results Polling details:
HTTP: GET
Endpoint:{baseEndpoint}/api/hotel/availability/async/{token}/results?nextResultsKey={{nextResultsKey}}
FAQs
For how long is the token that we received in the response valid?
The token is valid for 60 minutes.
How long should the Async API be polled for fresh results?
The API should be polled until its status is completed.
What happens if I don't get the cheapest rate from my fastest supplier?
The Async API will return the updated rate for a hotel once a lower fare is received.
Error Codes
Error Code | Error Message |
---|---|
4001 | Invalid data in request - Please refer to the fields[] for more details. |
5000 | Your request failed due to an unknown system error. Please contact support team with the correlationId. |
Updated 8 months ago
Please visit the following link:
Search Init:
https://zentrumhub-hotel-api.readme.io/reference/post_api-hotel-availability-init
Search Results:
https://zentrumhub-hotel-api.readme.io/reference/get_api-hotel-availability-async-token-results
Search Results Polling:
https://zentrumhub-hotel-api.readme.io/reference/get_api-hotel-availability-async-token-results