Create a new legal hold policy.
A custom policy for the sales team
500
A description for the policy.
2012-12-18T10:53:43-08:00
500
The filter end date.
When this policy is applied using a custodian
legal
hold assignments, it will only apply to file versions
created or uploaded inside of the
date range. Other assignment types, such as folders and
files, will ignore the date filter.
Required if is_ongoing
is set to false
.
2012-12-12T10:53:43-08:00
500
The filter start date.
When this policy is applied using a custodian
legal
hold assignments, it will only apply to file versions
created or uploaded inside of the
date range. Other assignment types, such as folders and
files, will ignore the date filter.
Required if is_ongoing
is set to false
.
true
Whether new assignments under this policy should continue applying to files even after initialization.
When this policy is applied using a legal hold assignment, it will continue applying the policy to any new file versions even after it has been applied.
For example, if a legal hold assignment is placed on a user today, and that user uploads a file tomorrow, that file will get held. This will continue until the policy is retired.
Required if no filter dates are set.
Sales Policy
254
The name of the policy.
Returns a new legal hold policy object.
Returns an error if required parameters are missing,
or neither is_ongoing
or filter dates are specified.
Returns an error if a policy with this name already exists.
An unexpected client error.
curl -X POST https://api.box.com/2.0/legal_hold_policies \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
-H 'Content-Type: application/json" '
-d '{
"policy_name": "Policy 3",
"description": "Automatic created policy"
}'
var policyParams = new BoxLegalHoldPolicyRequest()
{
PolicyName = "IRS Audit"
};
BoxLegalHoldPolicy policy = await client.LegalHoldPoliciesManager
.CreateLegalHoldPolicyAsync(policyParams);
BoxLegalHoldPolicy.Info policyInfo = BoxLegalHoldPolicy.create(api, name, description, startedAt, endedAt);
new_policy = client.create_legal_hold_policy('New Policy', is_ongoing=True)
print('Created legal hold policy with ID {0}'.format(new_policy.id))
client.legalHoldPolicies.create('IRS Audit')
.then(policy => {
/* policy -> {
type: 'legal_hold_policy',
id: '11111',
policy_name: 'IRS Audit',
description: '',
status: 'active',
assignment_counts: { user: 0, folder: 0, file: 0, file_version: 0 },
is_ongoing: true,
created_by:
{ type: 'user',
id: '22222',
name: 'Example User',
login: 'user@example.com' },
created_at: '2017-01-24T16:57:22-08:00',
modified_at: '2017-01-24T16:57:22-08:00',
deleted_at: null,
filter_started_at: null,
filter_ended_at: null }
*/
});
client.legalHolds.create(name: "New Folder") { (result: Result<LegalHoldPolicy, BoxSDKError>) in
guard case let .success(policy) = result else {
print("Error creating legal hold policy")
return
}
print("Created legal hold policy \"\(policy.name)\"")
}