| title | Add custom properties to a fileStorageContainer |
|---|---|
| description | Add custom properties to a fileStorageContainer. |
| author | tonchan-msft |
| ms.localizationpriority | medium |
| ms.subservice | onedrive |
| doc_type | apiPageType |
| ms.date | 11/14/2024 |
Namespace: microsoft.graph
Add custom properties to a fileStorageContainer object.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
[!INCLUDE app-permissions]
PATCH /storage/fileStorage/containers/{containerId}/customProperties| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, supply a JSON representation of a fileStorageContainerCustomPropertyDictionary, which is a map with string keys and fileStorageContainerCustomPropertyValue values.
You can specify the following properties when you create a custom property.
| Property | Type | Description |
|---|---|---|
| value | String | The value of the custom property. Required. |
| isSearchable | Boolean | A flag to indicate whether the property is searchable. Optional. The default value is false. |
If successful, this method returns a 201 Created response code.
The following example shows how to create a custom property called clientUniqueId for a container.
PATCH https://graph.microsoft.com/v1.0/storage/fileStorage/containers/{containerId}/customProperties
Content-Type: application/json
{
"clientUniqueId": {
"value": "c5d88310-1fc7-49be-80ca-e7d7a11e638b"
}
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response. By default, the property isn't searchable.
HTTP/1.1 201 CreatedThe following example shows how to create a searchable custom property called clientUniqueId for a container.
PATCH https://graph.microsoft.com/v1.0/storage/fileStorage/containers/b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z/customProperties
Content-Type: application/json
{
"clientUniqueId": {
"value": "c5d88310-1fc7-49be-80ca-e7d7a11e638b",
"isSearchable": true
}
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 201 Created