Remove metadata from an item
Remove metadata from an item
Removing an instance of a metadata template assigned to a file or
folder can be done using the item's id
, and the template's templateKey
and scope
.
Remove metadata from an file
Deleting an instance of a metadata template from a file be achieved by calling
the DELETE /files/:file_id/metadata/:templateKey/schema
API.
curl -i -X DELETE "https://api.box.com/2.0/files/12345/metadata/enterprise_27335/blueprintTemplate" \
-H "authorization: Bearer <ACCESS_TOKEN>"
await client.fileMetadata.deleteFileMetadataById(
file.id,
'enterprise' as DeleteFileMetadataByIdScope,
templateKey
);
client.file_metadata.delete_file_metadata_by_id(
file.id, DeleteFileMetadataByIdScope.ENTERPRISE.value, template_key
)
await client.FileMetadata.DeleteFileMetadataByIdAsync(fileId: file.Id, scope: DeleteFileMetadataByIdScope.Enterprise, templateKey: templateKey);
try await client.fileMetadata.deleteFileMetadataById(fileId: file.id, scope: DeleteFileMetadataByIdScope.global, templateKey: "properties")
BoxFile file = new BoxFile(api, "id");
file.deleteMetadata("myMetadataTemplate");
client.file(file_id='11111').metadata(scope='enterprise', template='myMetadata').delete()
await client.MetadataManager.DeleteFileMetadataAsync("11111", "enterprise", "marketingCollateral");
client.files.deleteMetadata('67890', client.metadata.scopes.GLOBAL, client.metadata.templates.PROPERTIES)
.then(() => {
// removal succeeded — no value returned
});;
client.metadata.delete(
forFileWithId: "11111",
scope: "enterprise",
templateKey: "personnelRecord"
) { (result: Result<Void, BoxSDKError>) in
guard case .success = result {
print("Error deleting metadata instance")
return
}
print("Metadata instance deleted")
}
This API returns a 204 No Content
API response with no response body when
the instance has been successfully removed from the file.
Remove metadata from an folder
Deleting an instance of a metadata template from a folder be achieved by calling
the DELETE /folders/:folder_id/metadata/:templateKey/schema
API.
curl -i -X DELETE "https://api.box.com/2.0/folders/4353455/metadata/enterprise_27335/blueprintTemplate" \
-H "authorization: Bearer <ACCESS_TOKEN>"
await client.folderMetadata.deleteFolderMetadataById(
folder.id,
'enterprise' as DeleteFolderMetadataByIdScope,
templateKey
);
client.folder_metadata.delete_folder_metadata_by_id(
folder.id, DeleteFolderMetadataByIdScope.ENTERPRISE.value, template_key
)
await client.FolderMetadata.DeleteFolderMetadataByIdAsync(folderId: folder.Id, scope: DeleteFolderMetadataByIdScope.Enterprise, templateKey: templateKey);
try await client.folderMetadata.deleteFolderMetadataById(folderId: folder.id, scope: DeleteFolderMetadataByIdScope.global, templateKey: "properties")
BoxFolder folder = new BoxFolder(api, "id");
folder.deleteMetadata("myMetadataTemplate");
client.folder(folder_id='11111').metadata(scope='enterprise', template='myMetadata').delete()
await client.MetadataManager.DeleteFolderMetadataAsync("11111", "enterprise", "marketingCollateral");
client.folders.deleteMetadata('67890', client.metadata.scopes.GLOBAL, client.metadata.templates.PROPERTIES)
.then(() => {
// removal succeeded — no value returned
});
client.metadata.delete(
forFolderWithId: "22222",
scope: "enterprise",
templateKey: "personnelRecord"
) { (result: Result<Void, BoxSDKError>) in
guard case .success = result {
print("Error deleting metadata instance")
return
}
print("Metadata instance deleted")
}
This API returns a 204 No Content
API response with no response body when
the instance has been successfully removed from the folder.