By default REST query /_api/web/lists/getbytitle('<list title>')/items
returns AuthrorId
(User Id for Created By
field):
{
"d": {
"results": [
{
//remaining output is omitted for clarity
"FileSystemObjectType": 0,
"Id": 1,
"ContentTypeId": "0x010070092C478B02EF49ADA0691DE01FFBF6",
"Title": "John Doe",
"Email": "[email protected]",
"ID": 1,
"Modified": "2015-01-21T07:33:21Z",
"Created": "2015-01-21T07:33:21Z",
"AuthorId": 17,
"EditorId": 17,
"OData__UIVersionString": "1.0",
"Attachments": false,
"GUID": "01e58248-b0fc-4353-ad59-64010d9bb331"
}
]
}
}
Using $expand
OData operator you can specify that the request returns projected fields from other lists and the values of lookups.
The following REST endpoint:
/_api/web/lists/getbytitle('<list title>')/items?$select=Author/Title,Author/EMail&$expand=Author
returns Title
and Email
for Author
(Created By
) column in list:
{
"d": {
"results": [
{
"__metadata": {
"id": "07849f26-815c-40df-ba3d-efaac658c066",
"uri": "https://contoso.sharepoint.com/_api/Web/Lists(guid'81916ced-b57f-4940-bf1a-eef4af00aaee')/Items(1)",
"etag": "\"1\"",
"type": "SP.Data.ContactsListItem"
},
"Author": {
"__metadata": {
"id": "b503837d-4cce-4b8f-96a4-26341abfc39a",
"type": "SP.Data.UserInfoItem"
},
"Title": "John Doe",
"EMail": "[email protected]"
}
}
]
}
}