Forum Discussion
NaleyKaran
Apr 09, 2023Copper Contributor
Create Multiple Document Libraries Using SharePoint HTTP Request
Hello, I was wondering if anyone knows how to create multiple libraries using SharePoint HTTP request. This is a case: I want to create a SharePoint site which has 7 document libraries(This ...
Michel Verwijmeren
Apr 09, 2023Brass Contributor
Hi NaleyKaran,
With the Microsoft Graph API, you are able to do so! Use the Lists EndPoint to create the new Library, but instead of the ‘genericList’ template, use the ‘documentLibrary’ template.
Furthermore, there is also a Create Folder endpoint which you can use to create and populate the folder structure.
Links for reference;
- https://learn.microsoft.com/en-us/graph/api/list-create?view=graph-rest-1.0&tabs=http
- https://learn.microsoft.com/en-us/graph/api/driveitem-post-children?view=graph-rest-1.0&tabs=http
Good luck!