Feb 09 2020 08:29 PM
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 specific library
- Change the folders content type to a custom one
- Update metadata on the folder
Can anyone please provide me an example of doing this?
Many thanks!
Feb 16 2020 05:52 PM
SolutionPOST /drives/{drive-id}/items/root/children
{
"name": "{name}",
"folder": { },
"@microsoft.graph.conflictBehavior": "fail"
}
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}"
}
}
Feb 16 2020 05:52 PM
SolutionPOST /drives/{drive-id}/items/root/children
{
"name": "{name}",
"folder": { },
"@microsoft.graph.conflictBehavior": "fail"
}
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}"
}
}