Reputation: 71
I am using Microsoft graph API. I made calls to get the lists of the sites and response resulted in listing all the lists available. Then used list id to fetch the items, but no items are displaying in the values field of response JSON. There are items in the list and can be seen in SharePoint. The API call made is to fetch the items -
https://graph.microsoft.com/v1.0/sites/abc.sharepoint.com,{SPSite.ID},{SPWeb.ID}/lists/{list-id}/items
and it returns-
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#sites('abc.sharepoint.com%2C792f04d7-8a76-4ccf-95fd-10e3293536c4%2Ca422fba2-947c-44ef-8134-ddd560d6bb3d')/lists('0c739bcd-8649-4fa6-bca4-a8dcea53e2c2')/items",
"value": []
}
To get the lists, which is working -
https://graph.microsoft.com/v1.0/sites/abc.sharepoint.com,{SPSite.ID},{SPWeb.ID}/lists/
and displays all the available lists.
I am referring this doc .
Using postman to make the calls.
Thanks
Upvotes: 0
Views: 380
Reputation: 4228
Try to use test query tool below to check if it works.
It works using the API below in my test.
https://graph.microsoft.com/v1.0/sites/abc.sharepoint.com,{Site GUID},{Web GUID}/lists/{List GUID}/items
You can also check if the list id is right.
Upvotes: 1