How to get delve url of SharePoint Online user using JavaScript?
-
20-12-2020 - |
Question
I am having user id of SharePoint Online user. Now I need to fetch the Delve profile url for this user.
How can I fetch the Delve URL of user by User ID?
I have gone through this. This does not provided delve URL when I tried.
Please suggest.
Solution 2
I was able to do this using following url:
SiteUrl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|user@siteurl.onmicrosoft.com'
Using this URL in REST API will give you all properties.
Found reference here
OTHER TIPS
To get the delve url of current user, you can hit below url:
https://tenantname-my.sharepoint.com/_layouts/15/me.aspx?v=profile
If you want the delve url of another user, you can hit below url:
https://tenantname-my.sharepoint.com/_layouts/15/me.aspx/?p=user.name%40tenantname.com&v=work
So, if a user's name is say, Gautam Sheth and he has valid email address like
gautam.sheth@abc.com
or gautam.sheth@tenantname.onmicrosoft.com
, then url be like:
https://tenantname-my.sharepoint.com/_layouts/15/me.aspx/?p=gautam.sheth%40abc.com&v=work
or
https://tenantname-my.sharepoint.com/_layouts/15/me.aspx/?p=gautam.sheth%40tenantname.onmicrosoft.com&v=work