Latest version

Get retention policy assignment

get
https://api.box.com/2.0
/retention_policy_assignments/:retention_policy_assignment_id

Retrieves a retention policy assignment

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
1233123

The ID of the retention policy assignment.

Query Parameters

string arrayin queryoptional
id,type,name

A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.

Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.

Response

Returns the retention policy assignment object.

application/jsonClient error

An unexpected client error.

get
Get retention policy assignment
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_policy_assignments/1233123" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
TypeScript Gen
await client.retentionPolicyAssignments.getRetentionPolicyAssignmentById(
  retentionPolicyAssignment.id,
);
Python Gen
client.retention_policy_assignments.get_retention_policy_assignment_by_id(
    retention_policy_assignment.id
)
.NET Gen
await client.RetentionPolicyAssignments.GetRetentionPolicyAssignmentByIdAsync(retentionPolicyAssignmentId: retentionPolicyAssignment.Id);
Swift Gen (Beta)
try await client.retentionPolicyAssignments.getRetentionPolicyAssignmentById(retentionPolicyAssignmentId: retentionPolicyAssignment.id)
Java
BoxRetentionPolicyAssignment assignment = new BoxRetentionPolicyAssignment(api, id);
BoxRetentionPolicyAssignment.Info assignmentInfo = assignment.getInfo("assigned_to");
Python
assignment = client.retention_policy_assignment('12345').get()
print(f'Assignment id is {assignment.id} and it is assigned by {assignment.assigned_by.name}')
.NET
BoxRetentionPolicyAssignment assignment = await client.RetentionPoliciesManager
    .GetRetentionPolicyAssignmentAsync("33333");
Node
client.retentionPolicies.getAssignment('12345').then((assignment) => {
	/* assignment -> {
			type: 'retention_policy_assignment',
			id: '12345',
			retention_policy:
			{ type: 'retention_policy',
				id: '11111',
				policy_name: 'Tax Documents' },
			assigned_to: { type: 'folder', id: '22222' },
			assigned_by:
			{ type: 'user',
				id: '33333',
				name: 'Example User',
				login: 'user@example.com' },
			assigned_at: '2015-07-20T14:28:09-07:00' }
		*/
});
iOS
client.retentionPolicy.getAssignment(assignmentId: "123456")  { result in
    guard case let .success(retentionPolicyAssignment) = result else {
        print("Error getting retention policy assignment")
        return
    }
    
    print("Retention policy assignment: \(retentionPolicyAssignment.id)")
}

Response Example

{
  "id": "11446498",
  "type": "retention_policy_assignment",
  "assigned_at": "2012-12-12T10:53:43-08:00",
  "assigned_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "assigned_to": {
    "id": "a983f69f-e85f-4ph4-9f46-4afdf9c1af65",
    "type": "metadata_template"
  },
  "filter_fields": [
    {
      "field": "a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4",
      "value": "0c27b756-0p87-4fe0-a43a-59fb661ccc4e"
    }
  ],
  "retention_policy": {
    "id": "12345",
    "type": "retention_policy",
    "disposition_action": "permanently_delete",
    "policy_name": "Some Policy Name",
    "retention_length": "365"
  },
  "start_date_field": "upload_date"
}