Template

by Rajesh Sitaraman

HTML

<script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
<div id='log'>
</div>

JavaScript

function logit(msg) {
  $('#log').append(msg + '</br>');
}

function geturl(user) {
  //user = 'wingtip\admin' (.....this the value that is passed into the funtion....)

//var weburl = _spPageContextInfo.webAbsoluteUrl;
var weburl = "http:\\intranet.wingtip.com";
weburl = weburl.replace(/\\/g,'\\\\');

return weburl+ "/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@V)@v='" + user + "'";

}

logit(geturl("wingtip\\admin"));