Get Author Email from SharePoint Rest API request

SharePoint 2016 Logo

If you want to get the Author login from the SharePoint object, for example, list item, you should use ‘expand=Author’ in the query. It’s necessary, but not sufficient. There’s one more option, which you must use.

A query, which returns the author Email, looks like this:

https://markimarta.sharepoint.com/sites/mysite/_api/web/lists/getByTitle(‘Answers’)/items?$select=ID,Title,UserSlots,Author/EMail&$expand=Author&$filter=+EventId+eq+34

M’ in the word ‘EMail’ must be capital.

If you think, that the register is not important, it’s a big mistake.
if you write in the query “$select=ID,Title,UserSlots,Author/Email&$expand=Author&…”, then you have an error like this:

<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-1, Microsoft.SharePoint.SPException</m:code>
<m:message xml:lang="en-US">The query to field 'Author/Email' is not valid.</m:message>
</m:error>

Microsoft is not like Tefal, he doesn’t always think of you 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *