I need code to get user profile properties by using JavaScript or JQuery
var url = appweburl +"/_api/SP.UserProfiles.PeopleManager/GetMyProperties";
var requestHeaders = {
"Accept": "application/json;odata=verbose"
};
var executor = new SP.RequestExecutor(appweburl);
executor.executeAsync(
{
url: url,
contentType: "application/json;odata=verbose",
method: "GET",
headers: requestHeaders,
success: function (data) {
var parsedData = JSON.parse(data.body);
alert(parsedData )
},
error: function (data) {
alert("failed");
console.log(data)
}
}
);
the above code always throw error "Access denied,You do not have permission to perform this action or access this resource". I am working on SharePoint office 365,any method using JavaScript or jquery is acceptable.