Back to Example List

Set up for the blow examples:

      var availability = new TTWeb.Availability({
        hotelId: 'KEY24N', //'NYCREF',
        portalId: '24northhotel',
        defaultTimezone: 'America/New_York',
        ipAddress: sessionStorage.ip_add
      })
    

Number of rooms left for base room

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

    
  

Number of rooms left for all rooms

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

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

    
  

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

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

      }).catch(function(error){
        document.getElementById('roomLeftResponse').innerHTML = JSON.stringify(error,null,4);
        console.log("roomsLeft('s1k')" );
        console.log(response);
      });
    
Response: