Identify QuickLaunch is Enabled for SharePoint Site Using REST API

Syntax

REST API Endpoint:

https://SharePointSiteURL/_api/web?$select=QuickLaunchEnabled

REST API endpoint to use in Add_ins:

<appweburl>/_api/SP.AppContextSite(@target)/web?$select=QuickLaunchEnabled&@target=<hostweburl>

Embed Code Snippet

The following code snippet can be embed in SharePoint page or in content editor web part as a script. This example used to check whether the quick launch is enabled for the SharePoint website. 
  1. <script type="text/javascript" src="/SiteAssets/Scripts/jquery.min.js"></script>    
  2. <script type="text/javascript">    
  3.     $.ajax(    
  4.     {    
  5.         url: _spPageContextInfo.webAbsoluteUrl + "/_api/web?$select=quicklaunchenabled"//THE ENDPOINT      
  6.         method: "GET",    
  7.         headers:    
  8.         {    
  9.             "Accept""application/json; odata=verbose"    
  10.         },    
  11.         success: function(data)    
  12.         {    
  13.             //RESULTS HERE!!      
  14.             console.log(data.d.QuickLaunchEnabled)    
  15.             if (data.d.QuickLaunchEnabled)    
  16.                 alert('Quick launch enabled on this site.');    
  17.             else    
  18.                 alert('Quick launch disabled on this site.');    
  19.         }    
  20.     });    
  21. </script>  

Add-in Code Snippet

The following code snippet is used in SharePoint Add-in to get the boolean property of QuickLaunchEnabled for the SharePoint website. 
  1. // Load the js files and continue to the successHandler      
  2. $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest);    
  3.   
  4. // Function to prepare and issue the request to get      
  5. // SharePoint data      
  6. function execCrossDomainRequest()    
  7. {    
  8.     // Initialize the RequestExecutor with the add-in web URL.      
  9.     var executor = new SP.RequestExecutor(appweburl);    
  10.     // Issue the call against the add-in web.      
  11.     // To get the QuickLaunchEnabled property using REST we can hit the endpoint:      
  12.     // appweburl/_api/web?select=QuickLaunchEnabled&@target=hostweburl      
  13.     // The response formats the data in the JSON format.      
  14.     executor.executeAsync(    
  15.     {    
  16.         url: appweburl + "/_api/SP.AppContextSite(@target)/web?$select=quicklaunchenabled&@target='" + hostweburl + "'",    
  17.         method: "GET",    
  18.         headers:    
  19.         {    
  20.             "Accept""application/json; odata=verbose"    
  21.         },    
  22.         success: successHandler,    
  23.         error: errorHandler    
  24.     });    
  25. }    
  26. // Function to handle the success event.      
  27. function successHandler(data)    
  28. {    
  29.     var jsonObject = JSON.parse(data.body)    
  30.         //jsonObject.d.QuickLaunchEnabled returns true if enabled otherwise it returns false      
  31.     console.log('Tree view enabled on this site: ' + jsonObject.d.QuickLaunchEnabled);    
  32.     if (jsonObject.d.QuickLaunchEnabled)    
  33.         $('#message').html('Quick launch enabled on this site.');    
  34.     else    
  35.         $('#message').html('Quick launch disabled on this site.');    
  36. }    
  37.     
  38. function errorHandler(data, errorCode, errorMessage)    
  39. {    
  40.     console.log("Could not complete cross-domain call: " + errorMessage);    
  41. }