Box Developer Documentation

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

Register now!

List metadata cascade policies

get
https://api.box.com/2.0
/metadata_cascade_policies

Retrieves a list of all the metadata cascade policies that are applied to a given folder. This can not be used on the root folder with ID 0.

Request

bearer [ACCESS_TOKEN]
application/json

Query Parameters

stringin queryrequired
31232

Specifies which folder to return policies for. This can not be used on the root folder with ID 0.

stringin queryoptional
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination.

This requires usemarker to be set to true.

integer (int64)in queryoptional
10000

The offset of the item at which to begin the response.

Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.

stringin queryoptional
31232

The ID of the enterprise ID for which to find metadata cascade policies. If not specified, it defaults to the current enterprise.

Response

Returns a list of metadata cascade policies

application/jsonClient error

Returns an error when any of the parameters are not in a valid format.

application/jsonClient error

Returns an error when the folder can not be accessed. This error often happens when accessing the root folder with ID 0.

application/jsonClient error

Returns an error when the folder can not be found or the user does not have access to the folder.

  • not_found - The folder could not be found or the user does not have access to the folder.
application/jsonClient error

An unexpected client error.

get
List metadata cascade policies
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

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
		}
		*/
	});

Response Example

{
  "entries": [
    {
      "id": "6fd4ff89-8fc1-42cf-8b29-1890dedd26d7",
      "type": "metadata_cascade_policy",
      "owner_enterprise": {
        "type": "enterprise",
        "id": "690678"
      },
      "parent": {
        "type": "folder",
        "id": "1234567"
      },
      "scope": "enterprise_123456",
      "templateKey": "productInfo"
    }
  ],
  "limit": 1000,
  "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
  "prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih"
}