Back to Example List
Set up for the blow examples:
var hotel1 = new TTWebHotel({
hotelId: 'KEY24N', //'NYCREF',
portalId: '24northhotel',
defaultTimezone: 'America/New_York',
ipAddress: sessionStorage.ip_add
});
Number of rooms left for base room
hotel1.ready(function() {
var availability = hotel1.Availability();
availability.roomsLeft().then(function(response){
document.getElementById('roomLeftBaseResponse').innerHTML = JSON.stringify(response,null,4);
}).catch(function(error){
document.getElementById('roomLeftBaseResponse').innerHTML = JSON.stringify(error,null,4);
});
});
Response:
Number of rooms left for all rooms
availability.roomsLeftAll().then(function(response){
document.getElementById('roomLeftAllResponse').innerHTML = JSON.stringify(response,null,4);
}).catch(function(error){
document.getElementById('roomLeftAllResponse').innerHTML = JSON.stringify(error,null,4);
});
Response:
Number of rooms left for a specific (e.g. ST1) room
availability.roomsLeft('','ST1').then(function(response){
document.getElementById('roomLeftResponse').innerHTML = JSON.stringify(response,null,4);
}).catch(function(error){
document.getElementById('roomLeftResponse').innerHTML = JSON.stringify(error,null,4);
});
Response: