2
votes

I am using Microsoft Graph API create a Document Library in a SharePoint Online site. I would like to know if there is a way to create at the same time I create the doc library a navigation link.

When working directly on SharePoint online there is a checkbox "Show in navigation link", which will automatically create a navigation link on the left column.

I could not find anything in the documentation, I would like to know if there is a way to do that thanks to the API.

POST https://graph.microsoft.com/v1.0/sites/{site-id}/lists

{
  "displayName": "TEST1",
  "list": {
    "contentTypesEnabled": false,
    "hidden": false,
    "template": "documentLibrary"
  }
}
1

1 Answers

0
votes

When checked, SharePoint is actually doing to things behind the scenes. First, it creates the Document Library. Then it adds a link to the Page. This isn't supported in v1.0.

I expect it will eventually become available given the recent introduction of the sitePage resource to the Beta API. At the moment there isn't a way to "update" an existing page so it likely wouldn't support your scenario today but it's logical to assume PATCHing a sitePage is coming at some point. .