We are using people picker (jQuery autocomplete) in a SharePoint Provider hosted app for binding the data of AD users.
We are using predefined web service Interface (ClientPeoplePickerWebServiceInterface
) from SharePoint.
In that we are getting only login name,email id, display name
etc. but we are not getting user id
. We require user id
to insert the data into list (people and group field) through REST API.
When we are using the below code we are getting user id using login name(i:0#.w|vf-root\empadmin
). It is working to get only SharePoint group users, but it is not working for all users who are in AD or user profile users.
Please help us to get user id
or to insert login name (with out using user id
) into people and group field.
/_api/web/siteusers/getbyloginname(@v)?@v='i%3A0%23.w%7Cvf-root\empadmin'
Update:
- We are unable to use
var context = new SP.ClientContext.get_current();
in provider hosted app. - We are calling
ClientPeoplePickerWebServiceInterface
through web method. - Using
"/_vti_bin/ListData.svc/UserInformationList? $select=Id,Name&$filter=substringof('" + searchKey + "',Name)";
we are only getting site users. We need user ids from user profile - Also, is there any possibility to insert user(people and group field) using login name
i:0#.w|vf-root\empadmin
through rest api (without user id)?