Share via

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

Anonymous
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 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author
  1. Shivam Dhiman 6,086 Reputation points
    2022-12-28T14:56:44.473+00:00

    Hi @Anonymous

    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 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-11-28T13:56:18.0666667+00:00

    i have this problem

    User's image

    User's image

    0 comments No comments

  2. Anonymous
    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

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.