In the Previous blog I have explained how to get item level attachment using REST API. Get User Profile Properties with REST API.

The User Profile service stores information about users in a central location.

Konnectogrow will provide you the best digital marketing services in Pune and Noida, we also provide web development services, app development services, and graphic designing services in Pune you can grab the services to increase your business. Microsoft SharePoint designer 2013 training is available at Konnectogrow Pune, we can give you the best SharePoint developer training with the handling of the live project. As well as we also provide Sharepoint services and the best SharePoint consulting services in Pune. Our SharePoint designer has uploaded the SharePoint image to make you understand what is SharePoint? You can grab all services from Konnectogrow Pune.

My Sites, social computing features such as social tagging and news feeds, and creating and distributing profiles across multiple sites and farms.

1) Get all properties of the current user:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties

2) Get single property of current user:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties/PictureUrl
OR
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl

3) Get Multiple Properties for the current user:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl,AccountName

4) Get all properties of Specific User:

For Office 365/SharePoint Online:
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v=’i:0%23.f|membership|vardhaman@siteurl.onmicrosoft.com’

For SharePoint 2013 On-Premises:
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v=’domain\username’

List of User Properties

AccountName
DirectReports
DisplayName
Email
ExtendedManagers
ExtendedReports
IsFollowed
LatestPost
Peers
PersonalUrl
PictureUrl”
Title
UserProfileProperties
UserUrl

Let’s see how we can do that using REST API :

var loggedinuserempno = “”;
var curruseremail = “”;
function GetCurrentUserProperties() {
var queryUrl = _spPageContextInfo.webAbsoluteUrl + “/_api/SP.UserProfiles.PeopleManager/GetMyProperties”;

var uid = _spPageContextInfo.userId;
$.ajax({
url: queryUrl,
method: “GET”,
headers: {
“accept”: “application/json;odata=verbose”
},
success: function (data) {
var result = data.d; var dname = result.DisplayName;
curruseremail = result.Email;
$(“#PreparedBy”).val(dname);
var arResults = result.UserProfileProperties.results;
var empno = “0”;

$.each(arResults, function () {
if (this.Key == “EmployeeNumber”) {
empno = this.Value;
loggedinuserempno = empno;
}
});
if (empno == “”) {
empno = “0”;}},
error: function (err) {
console.log(JSON.stringify(err));
}
});
}

Even you can create your Custom  property from Central admin and it’s totally depend on your requirement.

Konnectogrow will provide you the best digital marketing services in Pune and Noida, we also provide web development services, app development services, and graphic designing services in Pune you can grab the services to increase your business. Microsoft SharePoint designer 2013 training is available at Konnectogrow Pune, we can give you the best SharePoint developer training with the handling of the live project. As well as we also provide Sharepoint services and the best SharePoint consulting services in Pune. Our SharePoint designer has uploaded the SharePoint image to make you understand what is SharePoint? You can grab all services from Konnectogrow Pune.