Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phillipharding/7daff94e3738a32444337c6619294405 to your computer and use it in GitHub Desktop.
Save phillipharding/7daff94e3738a32444337c6619294405 to your computer and use it in GitHub Desktop.
Querying SharePoint List Items using the Graph API with a Server Relative Site URL and List Title

Query SharePoint List Items using the Graph API sites and lists

Uses a server relative site URL instead of a site id

Uses a list title instead of a list id

Expands the fields attribute and restricts the expanded fields to

  • id
  • Title
  • Author (Created by)
  • Editor (Modified by)
  • ApprovedBy (user field)
https://graph.microsoft.com/v1.0/sites/<tenant>.sharepoint.com:/sites/<site url name>:/lists/<list title>/items?$select=id,fields&$expand=fields($select=id,Title,Author,Editor,ApprovedBy)

For more details on using $filter, see https://mmsharepoint.wordpress.com/2021/01/11/use-microsoft-graph-to-query-sharepoint-items/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment