REST API to get current user of SharePoint Site/Get the data of current logged in user.

REST API to get current user of SharePoint Site/Get the data of current logged in user.

_spPageContextInfo.webServerRelativeUrl/Site URL + "/_api/web/currentuser"


OR

If you are using the SharePoint 2013 then you can use below details to get the data of current logged in user.

_spPageContextInfo.userDisplayName // It will give the Name of the User

_spPageContextInfo.userEmail //  It will give the email of the User

_spPageContextInfo.userId // It will give the User id of the User

_spPageContextInfo.userLoginName // It will give the User Name/email of the User

_spPageContextInfo.userPrincipalName //  It will give the Primary name/user name of the User

Comments

Popular posts from this blog

Get list item entity type full name of a SharePoint list using REST API

Get SharePoint list name by GUID

Get Current Web Logged In User of SharePoint Site in jQuery