DEV Community

Elio Struyf for Microsoft 365

Posted on • Originally published at eliostruyf.com on

1

#DevHack: Create SharePoint library with the Microsoft Graph

When you are reading this, you are looking to create a SharePoint library from the Microsoft Graph. It is straightforward but a bit confusing because you will have to use the lists endpoint. When you are a SharePoint developer, we all learned that a list is not the same as a library, and lists get created under the /lists/ URL path. Document libraries are not.

Info: Documentation to create a new list

When you want to create a new document library, you can perform the same call as mentioned in the create list documentation page instead of using the genericList template value. Use the documentLibrary value.

POST /sites/{site-id}/lists
Content-Type: application/json

{
  "displayName": "YourLibraryName",
  "list": {
    "template": "documentLibrary"
  }
}
Enter fullscreen mode Exit fullscreen mode

Info: More information about all properties can be found here: JSON body representation.

That is it for this #DevHack

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay