Add custom properties to a fileStorageContainer
Namespace: microsoft.graph
Add custom properties to a fileStorageContainer object.
Permissions
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.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | FileStorageContainer.Selected | Not available. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | FileStorageContainer.Selected | Not available. |
In addition to Microsoft Graph permissions, your app also must have the necessary container-type level permission or permissions to call this API. For details about container types, see Container Types. To learn more about container-type level permissions, see SharePoint Embedded Authorization.
HTTP request
PATCH /storage/fileStorage/containers/{containerId}/customProperties
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Content-Type | application/json. Required. |
Request body
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 . |
Response
If successful, this method returns a 200 Created
response code.
Examples
Example 1: Create a custom property
Request
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"
}
}
Response
The following example shows the response. By default, the property isn't searchable.
HTTP/1.1 200 Created
Example 2: Create a custom searchable property
Request
The 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
}
}
Response
The following example shows the response.
HTTP/1.1 200 Created