ファイルへのメタデータの適用
ファイルへのメタデータの適用
新しいcustomerData
テンプレートが完成したら、このテンプレートをファイルまたはフォルダに適用できます。このテンプレートを適用するには、テンプレートのscope
とtemplateKey
のほか、テンプレートの適用先となる項目のIDが必要になります。
cURL
curl -X POST https://api.box.com/2.0/files/12345/metadata/enterprise/customerInfo \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-H "content-type: application/json" \
-d '{
"name": "Box, Inc",
"industry": "Technology",
"tav": 1000000
}'
このAPIにより、新しく作成されたメタデータインスタンスが返されます。
{
"name": "Box, Inc",
"industry": "Technology",
"tav": 1000000,
"$id": "01234500-12f1-1234-aa12-b1d234cb567e",
"$parent": "folder_12345,",
"$scope": "enterprise_34567",
"$template": "customerInfo",
"$type": "customerInfo-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0",
"$typeVersion": 2,
"$version": 1,
"$canEdit": true
}