Back to Example List

Set up for the blow examples:

      var availability = new TTWeb.Availability({
        hotelId: 'KEY24N', //'NYCREF',
        portalId: '24northhotel'        
      })
    

Number of rooms left for base room

      availability.getRoomsLeft('base').then(function(response){
        document.getElementById('roomLeftBaseResponse').innerHTML = JSON.stringify(response,null,4);
        console.log("getRoomsLeft('base')" );
        console.log(response);
      }).catch(function(error){
        document.getElementById('roomLeftBaseResponse').innerHTML = JSON.stringify(error,null,4);
      });
    
Response:

    
  

Number of rooms left for all rooms

      availability.getRoomsLeft().then(function(response){
        document.getElementById('roomLeftAllResponse').innerHTML = JSON.stringify(response,null,4);
        console.log("rooms left - All Rooms" );
        console.log(response);

      }).catch(function(error){
        document.getElementById('roomLeftAllResponse').innerHTML = JSON.stringify(error,null,4);
      });      
    
Response:

    
  

Number of rooms left for a specific (e.g. S1K) room

      availability.getRoomsLeft('s1k').then(function(response){
        document.getElementById('roomLeftResponse').innerHTML = JSON.stringify(response,null,4);
        console.log("getRoomsLeft('s1k')" );
        console.log(response);

      }).catch(function(error){
        document.getElementById('roomLeftResponse').innerHTML = JSON.stringify(error,null,4);
      });      
    
Response: