Retrive User profile propertes using javascript rest api in sharepoint online

Mahesh C M 136 Reputation points

Hi Guys,

I have a sharepoint hosted app. In the application i have facing an issue in retrieving user profile properties using rest api call in javascript. Got an unauthorized exception while accessing the api. try to resolve this issue by provide a tenant read permission to application and then deploy the application , there is a deploy request has been send to the tenant admin , i have the tenant admin access and i approved the deployment request but nothing happens. Could anyone help me what is the best method to get the user profile from sharepoint online.

I have tried javascript object model to retrieve the user data. there also i got the same issue .(below given the link)

Microsoft 365 Publishing
Microsoft 365 Publishing
Microsoft 365: Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line. Publishing: The process of preparing, producing, and releasing content for distribution or sale.
491 questions
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,055 questions
{count} votes

Accepted answer
  1. Jerryzy 10,301 Reputation points

    Hi @MaeshCM-7927,

    You can use Rest API to get user Profile Propeties in SharePoint Hosted app like this:



    App Permision:


    While deploying, directly clicking the Trust:



    Best Regards

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments

0 additional answers

Sort by: Most helpful