I am currently working with a task where you have a SPList in one farm that holds some data that we need to aggregate into a view on another farm. Therefore I am working on a Visual Web Part that through the SharePoint 2013 REST API gets the items in the list and aggregates the information into a DataTable and then displays the information.
// Construct URI string restUrl = string.Format(SiteCollectionUrl + "/_api/web/lists/getByTitle('projectregister')/items" + "?$select=LeadId"); Uri uri = new Uri(restUrl);
The list however implements a SPFieldType.User where you can pick a user, and when looking at the XML the call returns, you only get an integer. I would have just implemented a method that looks up the user id and get the username, but that will not work because we are talking about aggregating data across two different SharePoint farms.
The internal name of the SPField is called "Lead", but somehow that does not exist when selecting it in the REST call and selecting all only returns LeadId and others not relevant to this question.
Does anyone know how to return the guid og the users name instead of that integer?