SharePoint 2013 How to get User Language Preferences with REST API

 
 <script src="/_layouts/15/sp.requestexecutor.js"></script>  
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>  
 <script type="text/javascript">  
   function handler(restURI, s, f) {  
     var restUrl = _spPageContextInfo.webAbsoluteUrl + restURI;  
     var executor = new SP.RequestExecutor(_spPageContextInfo.webAbsoluteUrl);  
     executor.executeAsync(  
       {  
         url: restUrl,  
         method: "GET",  
         headers: { "Accept": "application/json; odata=verbose" },  
         success: s,  
         error: f  
       }  
     );      
   }  
   function success(data) {      
     var jsonObject = JSON.parse(data.body);      
     var results = jsonObject.d.UserProfileProperties.results;       
     for (i = 0; i < results.length; i++) {  
       if (results[i].Key.indexOf("SPS-MUILanguages") > -1) {           
         $('#MUILanguages').append(results[i].Value);  
         break;          
       }  
     }  
   }  
   function fail(data, errorCode, errorMessage) {  
     $('#MUILanguages').append(errorMessage);   
   }  
   $(function () {  
     handler("/_api/SP.UserProfiles.PeopleManager/GetMyProperties", success, fail);  
   });  
 </script>  
 <div id="MUILanguages"> </div>  
Previous
Next Post »
2 Komentar
avatar

The given information was very excellent & Great tips, and awesome way to get exert tips from everyone,not only i like that post all peoples like that post,because of all given information was wonderful and it's very helpful for me.
html5 training in chennai

Balas
avatar

Thanks for sharing this information, it helped me a lot in finding valuable resources for my career
Dotnet Training in Chennai

Balas