I try to use the MS graph API to work with sharepoint sites. All works fine, except i can not find how to create a folder in root of a site (folders are documents library).
If i know the site id (SITEID) i can list folders in root of the site as drives
GET /v1.0/sites/SITEID/drives
I have ID for each item (it is like a drive ID). The i can list folders on drives (which are subfolders of top level folders on a site)
GET /v1.0/sites/SITEID/drives/DRIVEID/root/children
I can create folders in this place and subfolders
POST /v1.0/sites/SITEID/drives/DRIVEID/root/children
{
"name": "New Folder 2",
"folder": {}
}
But how to create a top level folder on a site? In fact, how to create new drive on a site?
I try to guess something like
POST /v1.0/sites/SITEID/drives
{
"name": "New Drive",
"folder": {}
}
But this doesn't work
Also, i tried to create a list https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/list_create
POST /v1.0/sites/SITEID/lists
{
"name": "Books",
"columns": [
{
"name": "Author",
"text": { }
},
{
"name": "PageCount",
"number": { }
}
],
"list": {
"template": "documentLibrary"
}
}
no success