MS Graph API - SharePoint List item attachments using Graph API

Akhil Sai 50 Reputation points
2024-10-22T16:24:09.84+00:00

Hello,

I've been trying to fetch attachments in SharePoint List items.

User's image

This is the query I'm using :

https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/?expand=fields(select=Title,Attachments)

User's image

It returns Attachments field with either true or false indicating the presence of attachment, but not the Attachment URL or Data.

Could you please help me get the Attachment URL of a List item.

Thanks.

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
{count} vote

Accepted answer
  1. Emily Du-MSFT 51,836 Reputation points Microsoft External Staff
    2024-10-23T08:11:57.0633333+00:00

    Currently, Get attachment Graph API can get an attachment that is attached to a user event, message, or group post. It does not support getting an attachment that is attached to list item.

    As a workaround, you could use REST API to get the attachment that is attached to list item.

    GET https://{tenant}.sharepoint.com/_api/web/lists/getbytitle('{list-title}')/items({item-id})?$expand=AttachmentFiles
    

    Meanwhile, to get list attachments by Graph API, I recommend you give suggestion in the feedback portal. Many features of current products are designed and upgraded based on customers’ feedback. With requirements like this increase, the problem may well be released in the future. Thanks for your understanding and support.

    References:

    https://www.billyperalta.com/Accessing%20SharePoint%20REST%20API%20using%20Postman/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Chennupati, Prasuna 0 Reputation points
    2024-12-04T19:38:48.54+00:00

    I need this same functionality as well.. as suggested, I created a Feedback item for this: https://feedbackportal.microsoft.com/feedback/idea/5272d0ff-74b2-ef11-95f5-6045bdbc7c39

    0 comments No comments

  2. Constantin Kwiatkowski 45 Reputation points
    2025-01-23T07:05:15.3866667+00:00

    Is this feature already implemented? If yes, please provide a sample for that.

    0 comments No comments

Your answer

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