SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,616 questions
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);