リテンションポリシーを作成します。
true
ポリシーの有効期限が近付いたときにファイルの所有者と共同所有者に通知するかどうか。
true
ファイルの所有者がリテンションを延長できるかどうか。
12312312
通知を送るユーザーのID
apple@example.com
ユーザーが通知に使用するメールアドレス
Tim Apple
通知を送るユーザーの名前
user
次の値に固定: user
permanently_delete
リテンションポリシーの廃棄アクション。
このアクションをpermanently_delete
に設定すると、ポリシーによって保持されているコンテンツが完全に削除されます。remove_retention
に設定すると、コンテンツへのリテンションポリシーの適用が解除され、リテンションポリシーの有効期限が切れた後は、ユーザーがコンテンツを削除できるようになります。
次の値のいずれか1つ: permanently_delete
,remove_retention
Some Policy Name
リテンションポリシーの名前
finite
リテンションポリシーのタイプ。リテンションポリシーのタイプは、finite
(コンテンツを保持する期間が事前にわかっている場合)、またはindefinite
(コンテンツを保持する期間が不明な場合)のいずれかになります。
次の値のいずれか1つ: finite
,indefinite
0
リテンションポリシーの期間。これはリテンションポリシーがコンテンツに割り当てられた後、有効である日数を示します。ポリシーのpolicy_type
がindefinite
である場合は、retention_length
もindefinite
になります。
新しいリテンションポリシーオブジェクトを返します。
infinite
リテンションポリシーに対してretention_length
が指定された場合、または誤ったdisposition_action
が設定された場合は、bad_request
エラーを返します。
指定した名前を持つリテンションポリシーがすでに存在する場合は、エラーを返します
予期しないクライアントエラー。
curl -X POST https://api.box.com/2.0/retention_policies \
-H 'Authorization: Bearer <ACCESS_TOKEN>" '
-H 'Content-Type: application/json" '
-d '{
"policy_name": "Some Policy Name",
"policy_type": "finite",
"retention_length": 365,
"disposition_action": "permanently_delete"
}'
var policyParams = new BoxRetentionPolicyRequest()
{
PolicyName = "Important Documents!",
PolicyType = "finite",
RetentionLength = 365,
DispositionAction = "remove_retention"
};
BoxRetentionPolicy policy = await client.RetentionPoliciesManager
.CreateRetentionPolicyAsync(policyParams);
BoxRetentionPolicy.createIndefinitePolicy(api, name);
policy_name = 'Test Indefinite Policy Name'
disposition_action = 'remove_retention'
indefinite_retention_policy = client.create_retention_policy(policy_name, disposition_action, float('inf'))
print('Indefinite Retention Policy ID is {0} and the policy name is {1}'.format(indefinite_retention_policy.id, indefinite_retention_policy.policy_name))
client.retentionPolicies.create(
'Tax Documents',
client.retentionPolicies.policyTypes.INDEFINITE,
client.retentionPolicies.dispositionActions.REMOVE_RETENTION)
).then(policy => {
/* policy -> {
type: 'retention_policy',
id: '123456789',
policy_name: 'Tax Documents',
policy_type: 'indefinite',
retention_length: 'indefinite',
disposition_action: 'remove_retention',
can_owner_extend_retention: false,
status: 'active',
are_owners_notified: true,
custom_notification_recipients: []
assignment_counts: { enterprise: 0, folder: 1, metadata_template: 0 },
created_by:
{ type: 'user',
id: '11111',
name: 'Example User',
login: 'user@example.com' },
created_at: '2015-05-01T11:12:54-07:00',
modified_at: '2015-06-08T11:11:50-07:00' }
*/
});