Join BoxWorks 2024 to discover what's possible with content and AI!
Register now!Retrieves all of the retention policies for an enterprise.
21312321
Filters results by the ID of the user who created policy.
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.
1000
1000
The maximum number of items to return per page.
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii
Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination.
Sales Policy
Filters results by a case sensitive prefix of the name of retention policies.
finite
Filters results by the type of retention policy.
Value is one of finite
,indefinite
Returns a list retention policies in the enterprise.
Returns a bad_request
if a non existent policy_type
was specified.
Returns a not_found
error if the user specified in created_by_user_id
does not exist.
An unexpected client error.
curl -i -X GET "https://api.box.com/2.0/retention_policies" \
-H "authorization: Bearer <ACCESS_TOKEN>"
await client.retentionPolicies.getRetentionPolicies();
client.retention_policies.get_retention_policies()
await client.RetentionPolicies.GetRetentionPoliciesAsync();
try await client.retentionPolicies.getRetentionPolicies()
Iterable<BoxRetentionPolicy.Info> policies = BoxRetentionPolicy.getAll(api);
for (BoxRetentionPolicy.Info policyInfo : policies) {
// Do something with the retention policy.
}
retention_policies = client.get_retention_policies()
for policy in retention_policies:
print(f'The policy ID is {policy.id} and the name is {policy.policy_name}')
BoxCollectionMarkerBased<BoxRetentionPolicy> policies = await client.RetentionPoliciesManager
.GetRetentionPoliciesAsync();
client.retentionPolicies.getAll({ policy_name: 'Tax' }).then((policies) => {
/* policies -> {
entries:
[ { type: 'retention_policy',
id: '123456789',
name: 'Tax Documents' } ],
limit: 100,
next_marker: 'someMarkerString' }
*/
});
let iterator = client.retentionPolicy.list(type: .indefinite)
iterator.next { results in
switch results {
case let .success(page):
for policy in page.entries {
print("Retention policy \(policy.id)")
}
case let .failure(error):
print(error)
}
}
{
"entries": [
{
"id": "12345",
"type": "retention_policy",
"policy_name": "Some Policy Name",
"retention_length": "365",
"disposition_action": "permanently_delete",
"description": "Policy to retain all reports for at least one month",
"policy_type": "finite",
"retention_type": "non_modifiable",
"status": "active",
"created_by": {
"id": "11446498",
"type": "user",
"name": "Aaron Levie",
"login": "ceo@example.com"
},
"created_at": "2012-12-12T10:53:43-08:00",
"modified_at": "2012-12-12T10:53:43-08:00",
"can_owner_extend_retention": false,
"are_owners_notified": false,
"custom_notification_recipients": [
{
"id": "11446498",
"type": "user",
"name": "Aaron Levie",
"login": "ceo@example.com"
}
],
"assignment_counts": {
"enterprise": 1,
"folder": 1,
"metadata_template": 1
}
}
],
"limit": 1000,
"next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"
}