Forum Discussion
Nigel Witherdin
Feb 10, 2020Iron Contributor
How to create and change a folder's content type using the MS Graph API
Hi, I need to create a folder using the Graph API, then change its content type and set metadata against it. Ideally I would like to use SharePoint end points (/site/) to: - Create the folder in a...
- Feb 17, 2020
- Create the folder:
POST /drives/{drive-id}/items/root/children
{
"name": "{name}",
"folder": { },
"@microsoft.graph.conflictBehavior": "fail"
}
- Get the created folder's item id:
GET /drives/{drive-id}/items/root:/{folder-name}?expand=sharepointIds - Update folder's content type and metadata:
PATCH /sites/{site-id}/lists/{library-name}/items/{item-id}
{
"contentType":
{
"id": "{content-type-id}"
},
"fields":
{
"field_1_name": "{field_1_value}",
"field_2_name": "{field_2_value}"
}
}
- Create the folder:
Nigel Witherdin
Feb 17, 2020Iron Contributor
- Create the folder:
POST /drives/{drive-id}/items/root/children
{
"name": "{name}",
"folder": { },
"@microsoft.graph.conflictBehavior": "fail"
}
- Get the created folder's item id:
GET /drives/{drive-id}/items/root:/{folder-name}?expand=sharepointIds - Update folder's content type and metadata:
PATCH /sites/{site-id}/lists/{library-name}/items/{item-id}
{
"contentType":
{
"id": "{content-type-id}"
},
"fields":
{
"field_1_name": "{field_1_value}",
"field_2_name": "{field_2_value}"
}
}