Box Developer Documentation

Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

List metadata cascade policies

List metadata cascade policies

Metadata cascade policies can be listed for a folder by calling the GET /metadata_cascade_policies API endpoint with a folder_id.

cURL
curl -i -X GET "https://api.box.com/2.0/metadata_cascade_policies?folder_id=31232" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
TypeScript Gen
await client.metadataCascadePolicies.getMetadataCascadePolicies({
  folderId: folder.id,
} satisfies GetMetadataCascadePoliciesQueryParams);
Python Gen
client.metadata_cascade_policies.get_metadata_cascade_policies(folder.id)
.NET Gen
await client.MetadataCascadePolicies.GetMetadataCascadePoliciesAsync(queryParams: new GetMetadataCascadePoliciesQueryParams(folderId: folder.Id));
Swift Gen (Beta)
try await client.metadataCascadePolicies.getMetadataCascadePolicies(queryParams: GetMetadataCascadePoliciesQueryParams(folderId: folder.id))
Java
String folderID = "2222";
BoxFolder folder = new BoxFolder(api, folderID);
Iterable<BoxMetadataCascadePolicy.Info> metadataCascadePolicies = folder.getMetadataCascadePolicies();
for (BoxMetadataCascadePolicy.Info policyInfo : metadataCascadePolicies) {
    // take action on policy here
}
Python
cascade_policies = client.folder(folder_id='22222').get_metadata_cascade_policies()
for policy in cascade_policies:
    print(f'Metadata template {policy.templateKey} is cascaded')
.NET
BoxCollectionMarkerBased<BoxMetadataCascadePolicy> metadataCascadePolicies = await client.MetadataCascadePolicyManager.GetAllMetadataCascadePoliciesAsync("12345");
Node
var folderID = '22222';
client.metadata.getCascadePolicies(folderID)
	.then(cascadePolicies => {
		/* cascadePolicies -> {
			limit: 100,
			entries: [
				{
					id: '84113349-794d-445c-b93c-d8481b223434',
					type: 'metadata_cascade_policy',
					owner_enterprise: {
						type: 'enterprise',
						id: '11111'
					},
					parent: {
						type: 'folder',
						id: '22222'
					},
					scope: 'enterprise_11111',
					templateKey: 'testTemplate'
				}
			],
			next_marker: null,
			prev_marker: null
		}
		*/
	});

Pagination

This API uses marker-based pagination and can return a next_marker value in the response body to indicate that more templates might be available.