How to upload multiple files in sharepoint using graph api?

Prerit Pushp 21 Reputation points
2022-11-30T11:50:42.837+00:00

I am trying to upload multiple files in sharepoint library using graph api in postman. I am able to upload a single file using this http PUT request :-

https://graph.microsoft.com/v1.0/drives/{drive ID}/items/root:/{filename.txt}:/content

What could be the http request to upload multiple files at once.

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2022-12-01T05:45:37.367+00:00

    Hi @Prerit Pushp
    Per my research, we can only upload one file at once call the graph api. There is no such api to store multiple files in body and upload them to SharePoint library at once. As a workaround, we can loop to run this api and request multiple times to upload files collection. I will recommend you to use Power App, please refer to the following url to reach your requirement

    https://graph.microsoft.com/v1.0/sites/{sites id}/drive/items/root:/{filepath}:/content  
    

    Here is the video link for more details
    https://www.youtube.com/watch?v=EMBvuWbIPfE


    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.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.