Reservations Push Machinery

The push machinery allows the Channel to notify WuBook about new reservation or about modification/cancellation of existing reservation. We strongly suggest to implement the push machinery in order to lower the number of reservations fetching requests from WuBook and also reduce the risk of overbookings.

There are two ways to develop the push machinery:
  1. Semi-push – the channel just notify WuBook the existence of a new/modified/canceled booking and then WuBook make a request for reservations retrieval.

  2. Full-push – the channel sends full reservation data in the push request

Anyway should use HTTPS Basic Authorization in order to make a push request to WuBook. It means the push request from the channel should contain an “Authorization” header. The username and password for the channel will be provided by WuBook.

The URL for pushing looks like:

https: //wubook.net/__wdpushes__/channel_id/?hotel_id=xxx

channel_id is the channel identifier and will be provided by WuBook hotel_id is the channel’s identifier of the hotel which received a new reservation

Another attribute can also be appended to the URL, it is booking_id (&booking_id=xxxx), which represents the identifier of the reservation in the OTA system (it means that a reservation that is created, then modified and eventually cancelled should maintain the same booking ID). This field is not mandatory, but it is recommended if it can be provided in the URL.

For semi-push the Channel just makes a request using URL above. It can be GET-request or POST- request with empty body. After that, WuBook will make a reservations retrieval request for the mentioned hotel.

For full-push the Channel makes a POST-request using URL above and sends a full reservation data in the body of the POST-request. Only one reservation should be sent for each POST-request. Just send the dictionary (object) which represents the single reservation, using the format described in section “Reservations retrieval”. It is important that a pushed reservation is perfectly EQUAL to the same reservation returned by get_bookings service.

Please note that WuBook will make reservations fetching requests anyway, even if you choose a full-push method, but the frequence of these requests will be much lower if the channel implements push machinery. That behavior guarantees the reservation will be integrated by WuBook even if the push notification was failed or missed for some reason.

Response from WuBook

{
  "code": 200,
}

WuBook replies with one of the following codes:

Code

Error

Description

200

success

WoBook successfully parsed you request

400

parse error

WuBook couldn’t parse your request or reservation data. In this case of full-push it means thereservation wasn’t received by WuBook and you should try to re-send the push request, after checking the request.

401

invalid hotel_id

the hotel_id specified in the url is unkonown to WuBook

402

authentication error

the basic authentication has failed