Approach
In addition to server side object model available in previous versions, Search and User Profiles in SharePoint 2013 provides the following set of API's.
- .NET Client Object Model
- REST Service
- JavaScript Client Object Model
Prerequisites
For search you need to have the following prerequisites based upon the approach you are using.
- Microsoft.SharePoint.Client.Search.dll - If you are making use of .NET client object model you need to add reference to this dll.
- SP.Search.js - If you are using JSOM, you need to ensure that this js file is loaded on the page.
- http://<siteUri>/_api/search/- If you are making a REST call then you need to use this access point.
For user profiles you need to have the following prerequisites based upon the approach you are using.
- Microsoft.SharePoint.Client.UserProfiles.dll - If you are making use of .NET client object model you need to add reference to this dll.
- SP.UserProfiles.js - If you are using JSOM, you need to ensure that this js file is loaded on the page.
- http://<siteUri>/_api/SP.UserProfiles.PeopleManager - If you are making a REST call then you need to use this access point.
Implementation
Let us jump into the actual implementation so that there is more clarity.
Fetch All Users
As we discussed above, using people search we can fetch all the users.
Performing People Search using REST API
https://social.technet.microsoft.com/wiki/contents/articles/25074.sharepoint-online-working-with-people-search-and-user-profiles.aspx
Comments
Post a Comment