I can not find the User Information List for my sharepoint site. I have people picker column in my list and I can assign them. Also I get the lookup Id value. But when I call the graph API with this url,
https://graph.microsoft.com/v1.0/sites/{siteid}/lists/User Information List/items?$expand=fields
I get The specified list was not found
error.
I have tried the same url in a new test sharepoint site and it is returning the user values. Also when I call the sharepoint API like this,
https://site/_api/Web/GetUserById(10)
I am getting the result.
So the user information list exits. But name is different or something. Now how can I find the user list?
I have Sites.Read.All permission.
To fetch the User Information List, use the below query:
https://graph.microsoft.com/v1.0/sites/SiteID/lists?$filter=displayName eq 'User Information List'
The error you are facing is because you are passing User Information List
instead of the List ID.
You can also fetch the ListID of the Site by using below query:
GET https://graph.microsoft.com/v1.0/sites/SiteID/lists
Otherwise, as mentioned by you can also browse this link https://TenantName.sharepoint.com/sites/SiteName/_catalogs/users/detail.aspx
to get to the User information list:
Reference:
User Information List in SharePoint and Accessing it via Graph API - Athen by Naveenkumar Periyasamy