Skip to content

Latest commit

 

History

History
137 lines (107 loc) · 4.13 KB

File metadata and controls

137 lines (107 loc) · 4.13 KB
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

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.

[!INCLUDE permissions-table]

[!INCLUDE app-permissions]

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 201 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"
  }
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]



Response

The following example shows the response. By default, the property isn't searchable.

HTTP/1.1 201 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
  }
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]



Response

The following example shows the response.

HTTP/1.1 201 Created