List policy's 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

application/json

Path Parameters

stringin pathrequired
982312

The ID of the retention policy.

Query Parameters

integer / int64in queryoptional
10001000-1000

The maximum number of items to return per page.

stringin queryoptional
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

The position marker at which to begin the response.

This requires usemarker to be set to true.

stringin queryoptional
folder

The type of the retention policy assignment to retrieve.

Value is one of "folder", "enterprise"

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.

You can now try out some of our APIs live, right here in the documentation.
Log In

Request Example

cURL
curl -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

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