How do we get the item content from a Sharepoint list through a HTTP request via Microsoft Graph?

Yerli, Merve 21 Reputation points
2022-12-28T10:36:54.043+00:00

Hello everyone,

We have a PowerApp embedded in MS Teams which is a form that submits data to a Sharepoint list. And we want to access the data of the list. We can access the List itself and see the items in the list, but we would also like to see its content.

We would like to access this specific content in the list through a HTTP request. We have been working with Microsoft Graph but we cannot find the right request.

We tried this GET request and we were successfull in collecting the individual list items >>>> /sites/{site-id}/lists/{list-id}/items

But we would like to access the item content aswell, if that is even possible. We couldn't find a path on learnmicrosoft that would fit this criteria.

Also, is it possible to retrieve data in real time by using a Webhook for example without being a premium member?

We also tried >>>> https://graph.microsoft.com/v1.0/sites/{site id}/drive/root:/File1.xlsx, but the response in Postman we got is "access denied" and MS Graphs response is "items not found".

Help would be much appreciated.

Yours sincerely,

Merve

Microsoft Graph Site Lists API
Microsoft Graph Site Lists API
A Microsoft API that "supports access to SharePoint sites, lists, and drives; read-only support for site resources; read-write support for lists, listItems, and driveItems; and address resources by SharePoint ID, URL, or relative path.
264 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,076 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
1,698 questions
No comments
{count} votes

Accepted answer
  1. Shivam Dhiman-MSFT 4,486 Reputation points Microsoft Employee
    2022-12-28T14:56:44.473+00:00

    Hi @Yerli, Merve

    If you are looking to get the Sites lists items, you can use this
    GET https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items?$expand=fields Graph API endpoint or
    GET https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items/{item-id} for specific item or
    GET https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items/{item-id}/driveItem to download.

    For Sites drive items, you can follow the below steps

    For Excel file use the below Graph API endpoint:
    GET https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/worksheets/{id|name}/range(address='A1:B2')

    The error item not found can be because the file location is different. As you have mentioned you are getting access denied, could you please check your azure app if you have consented respective permission. Graph Explorer permission are Enterprise Application permission and Postman App is related to Azure App permissions.

    Reference's

    Hope this helps.

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


1 additional answer

Sort by: Most helpful
  1. Yerli, Merve 21 Reputation points
    2023-01-04T10:49:00.03+00:00

    Hi,

    thank you so much for your response and well researched answer and sorry for my own late response, I did not work over the holidays so I did not log into this account at all, my bad!

    Also, happy new year!

    The first Get request (GET https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items?$expand=fields) helped us out. Now we can see all the items of our list including the content!

    Thanks so much again and have a healthy new year.

    Yours sincerely,

    Merve

    No comments