Microsoft 365 and Office | SharePoint Server | For business
A family of Microsoft on-premises document management and storage systems.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to create Document Library in my subsite using graph API.
In Attached screenshot i have created two Document Library manually so I want to create same using graph API.
hi, try bellow code:
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var list = new List
{
DisplayName = "Books",
Columns = (IListColumnsCollectionPage)new List<ColumnDefinition>()
{
new ColumnDefinition
{
Name = "Author",
Text = new TextColumn
{
}
},
new ColumnDefinition
{
Name = "PageCount",
Number = new NumberColumn
{
}
}
},
ListInfo = new ListInfo
{
Template = "genericList"
}
};
await graphClient.Sites["{site-id}"].Lists
.Request()
.AddAsync(list);