Can't access sharepoint lists or drives through graph api

Kennel, Michael 26 Reputation points
2022-05-09T15:15:09.917+00:00

Hello, I'm trying to access a list and some drives on one of my organization's sharepoint sites via the graph api. I can successfully get the site information from the '/sites/ endpoint. When I try to get lists or drives the request comes back successful but with an empty array for the value.
200319-image.png

Sending a request for the specific list/drive gives a 404 response, which is not entirely unexpected since it didn't list anything in the previous request.
200320-image.png

I've tried creating multiple lists in an effort to get any of them to show up with no luck. Is there a permissions setting I'm missing somewhere to allow these items to be fetched by the graph API?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,714 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,736 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shivam Dhiman 5,946 Reputation points
    2022-05-09T16:29:19.76+00:00

    Hi @Kennel, Michael

    I am able to replicate your issue. Empty lists usually means that required permissions are missing. To get list items from SharePoint sites you need following permissions.

    200412-permissions2.png

    Please refer to this documentation.

    After adding all the required permissions I am able to get desired result.

    Result
    200403-result1.png

    Hope this helps,

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Kennel, Michael 26 Reputation points
    2022-05-09T16:37:39.797+00:00

    Perfect, thank you @ShivamDhiman-1582. I had the wrong permission selected for the application I was building.

    1 person found this answer helpful.
    0 comments No comments