Upload file attachments to sharepoint list item with graph API using C#

Ranga Prasad Konanki 0 Reputation points
2024-07-03T06:37:07.1866667+00:00

Have to upload the file attachments to sharepoint list item by using graph API with C#

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

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 36,171 Reputation points Microsoft Vendor
    2024-07-04T01:32:46.1966667+00:00

    Hi @Ranga Prasad Konanki,

    Currently Graph API doesn't support, add/update/view attachments of list item. You can upvote this feature request attach files to list items, based on the people requesting for this feature Microsoft Product team implement the feature.

    As a workaround, you could use rest api to upload attachment files

    /_api/lists/GetByTitle('" + listName + "')/items(" + itemId + ")/AttachmentFiles/add(FileName='" + file.name + "')
    
    
    

    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.


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.