Search code examples
microsoft-graph-api

GraphApi permissions - unable to read list values while it is possible to read columns info


I am able to query graphapi for columns, GET request:

/v1.0/sites/{siteId}/lists/{listId}/columns

But when I try to get list values, also GET request, i get empty array

/v1.0/sites/{siteId}/lists/{listId}/items

(also tried with appending ?expand=fields(select=fieldName), where fieldName was name listed by columns GET response)

result:

{
   "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('{siteId}')/lists('{listId}')/items",
   "value": []
}

When i try to create row using POST request i receive access denied. I am accessing api using rest requests from soapui, my app which i use has Sites.Selected API permission and the site which I am using was assigned permission by link:

https://{domain}.sharepoint.com/sites/{siteName}/_layouts/15/appinv.aspx

According to documentation to receive columns and list items same permission are required i.e. Sites.Read.All https://learn.microsoft.com/en-us/graph/api/list-list-columns?view=graph-rest-1.0&tabs=http https://learn.microsoft.com/en-us/graph/api/listitem-list?view=graph-rest-1.0&tabs=http

Any idea why I can list columns but cannot list items (receive empty array as a result)?


Solution

  • It turned out that Right="FullControl" was required