Force the metadata on a folder with a metadata cascade policy to be applied to all of its children. This can be used after creating a new cascade policy to enforce the metadata to be cascaded down to all existing files within that folder.
6fd4ff89-8fc1-42cf-8b29-1890dedd26d7
The ID of the cascade policy to force-apply.
"none"
Describes the desired behavior when dealing with the conflict where a metadata template already has an instance applied to a child.
none
will preserve the existing value on the fileoverwrite
will force-apply the templates values over
any existing values.Value is one of none
,overwrite
Returns an empty response when the API call was successful. The metadata cascade operation will be performed asynchronously.
The API call will return directly, before the cascade operation is complete. There is currently no API to check for the status of this operation.
Returns an error when the policy can not be found or the user does not have access to the folder.
instance_not_found
- The policy could not be foundnot_found
- The folder could not be found or the user does not have
access to the folder.An unexpected client error.
curl -i -X POST "https://api.box.com/2.0/metadata_cascade_policies/21312/apply" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-H "content-type: application/json" \
-d '{
"conflict_resolution": "overwrite"
}'
await client.metadataCascadePolicies.applyMetadataCascadePolicy(
cascadePolicyId,
{
conflictResolution:
'overwrite' as ApplyMetadataCascadePolicyRequestBodyConflictResolutionField,
} satisfies ApplyMetadataCascadePolicyRequestBody,
);
client.metadata_cascade_policies.apply_metadata_cascade_policy(
cascade_policy_id, ApplyMetadataCascadePolicyConflictResolution.OVERWRITE.value
)
await client.MetadataCascadePolicies.ApplyMetadataCascadePolicyAsync(metadataCascadePolicyId: cascadePolicyId, requestBody: new ApplyMetadataCascadePolicyRequestBody(conflictResolution: ApplyMetadataCascadePolicyRequestBodyConflictResolutionField.Overwrite));
String cascadePolicyID = "e4392a41-7de5-4232-bdf7-15e0d6bba067";
BoxMetadataCascadePolicy policy = new BoxMetadataCascadePolicy(api, cascadePolicyID);
policy.forceApply("none");
from boxsdk.object.metadata_cascade_policy import CascadePolicyConflictResolution
cascade_policy = client.metadata_cascade_policy(policy_id='84113349-794d-445c-b93c-d8481b223434')
cascade_policy.force_apply(CascadePolicyConflictResolution.PRESERVE_EXISTING)
print('Cascade policy was force applied!')
string policyId = "11111";
string conflictResolution = Constants.ConflictResolution.Overwrite
BoxMetadataCascadePolicy newCascadePolicy = client.MetadataCascadePolicyManager
.ForceApplyCascadePolicyAsync(policyId, conflictResolution);
var policyID = '84113349-794d-445c-b93c-d8481b223434';
client.metadata.forceApplyCascadePolicy(policyID, client.metadata.cascadeResolution.PRESERVE_EXISTING)
.then(() => {
// application started — no value returned
});