List retention policy assignments

get
https://api.box.com/2.0
/retention_policies/:retention_policy_id/assignments/

Returns a list of all retention policy assignments associated with a specified retention policy.

Request

Bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
982312

The ID of the retention policy.

Query Parameters

stringin queryoptional
folder

The type of the retention policy assignment to retrieve.

Value is one of folder,enterprise

integer / int64in queryoptional
10001000

The maximum number of items to return per page.

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.

Response

Returns a list of the retention policy assignments associated with the specified retention policy.

application/jsonClient error

Returns an error if an unknown type is specified.

application/jsonClient error

An unexpected client error.

get
List retention policy assignments
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/retention_policies/982312/assignments" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxCollectionMarkerBased<BoxRetentionPolicyAssignment> assignments = await client.RetentionPoliciesManager
    .GetRetentionPolicyAssignmentsAsync(retentionPolicyId: "11111");
Java
BoxRetentionPolicy policy = new BoxRetentionPolicy(api, id);
Iterable<BoxRetentionPolicyAssignment.Info> allAssignments = policy.getAllAssignments("assigned_by");
Iterable<BoxRetentionPolicyAssignment.Info> folderAssignments = policy.getFolderAssignments(50, "assigned_by");
Iterable<BoxRetentionPolicyAssignment.Info> enterpriseAssignments = policy.getEnterpriseAssignments();
for (BoxRetentionPolicyAssignments.Info assignmentInfo : allAssignments) {
	// Do something with the assignment.
}
for (BoxRetentionPolicyAssignments.Info assignmentInfo : folderAssignments) {
	// Do something with the assignment.
}
for (BoxRetentionPolicyAssignments.Info assignmentInfo : enterpriseAssignments) {
	// Do something with the assignment.
}
Node
client.retentionPolicies.getAssignments('123456789', {type: 'folder'})
	.then(assignments => {
		/* assignments -> {
			entries: [ { type: 'retention_policy_assignment', id: '12345678' } ],
			limit: 100,
			next_marker: 'someMarkerString' }
		*/
	});

Response Example

{
  "entries": [
    {
      "id": 11446498,
      "type": "retention_policy_assignment",
      "retention_policy": {
        "id": 12345,
        "type": "file_version",
        "policy_name": "Some Policy Name",
        "retention_length": 365,
        "disposition_action": "permanently_delete"
      },
      "assigned_to": {
        "id": 11446498,
        "type": "file"
      },
      "assigned_by": {
        "id": 11446498,
        "type": "user",
        "name": "Aaron Levie",
        "login": "ceo@example.com"
      },
      "assigned_at": "2012-12-12T10:53:43-08:00"
    }
  ],
  "limit": 1000,
  "next_marker": 3000,
  "prev_marker": 1000
}