リテンションポリシーを更新

put
https://api.box.com/2.0
/retention_policies/:retention_policy_id

リテンションポリシーを更新します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

パスパラメータ

stringパス内必須
982312

リテンションポリシーのID。

リクエスト本文

boolean本文内省略可能
false

リテンション期間が終了に近づいたときに、ポリシーが適用されている項目の所有者と共同所有者に通知するかどうかを決定します。

boolean本文内省略可能
false

元のリテンション期間が終了に近づいたときに、ポリシーが適用されている項目の所有者がリテンションを延長できるかどうかを決定します。

リテンション期間が終了に近づいたときに通知されるユーザーのリスト。

string本文内省略可能
"Policy to retain all reports for at least one month"

リテンションポリシーのテキストによる追加の説明。

string 本文内
"permanently_delete"

リテンションポリシーの廃棄アクション。このアクションをpermanently_deleteに設定すると、ポリシーによって保持されているコンテンツが完全に削除されます。remove_retentionに設定すると、コンテンツへのリテンションポリシーの適用が解除され、リテンションポリシーの有効期限が切れた後は、ユーザーがコンテンツを削除できるようになります。disposition_actionを変更しない場合は「null」を使用できます。

string本文内省略可能
"Some Policy Name"

リテンションポリシーの名前

string (int32) / number (int32) 本文内
"365"

リテンションポリシーの期間。この値はリテンションポリシーがコンテンツに割り当てられた後、有効である日数を示します。ポリシーのpolicy_typeindefiniteである場合は、retention_lengthindefiniteになります。

string本文内省略可能
"non-modifiable"

以下のリテンションの種類を指定します。

  • modifiable: リテンションポリシーを変更できます。たとえば、フォルダの追加と削除、ポリシー期間の短縮と延長、または割り当ての削除を行うことができます。リテンションポリシーが規制目的に関連していない場合はこの種類を使用してください。
  • non-modifiable: フォルダの追加、期間の延長、ポリシーの撤回、廃棄アクションまたは通知設定の変更という限られた方法でしかリテンションポリシーを変更できません。割り当ての削除やポリシー期間の短縮など、その他の操作は実行できません。規制に関するリテンションポリシーを確実に遵守する場合はこの種類を使用してください。

リテンションポリシーを更新する際は、non-modifiableの種類のみを使用できます。modifiableポリシーをnon-modifiableに変換することはできますが、その逆はできません。

string本文内省略可能
"retired"

リテンションポリシーを撤回する場合に使用します。

ポリシーを撤回しない場合は、このパラメータを含めないようにするか、 このパラメータをnullに設定します。

レスポンス

更新されたリテンションポリシーオブジェクトを返します。

誤ったdisposition_actionが設定された場合、または説明の文字数が上限の500文字を超える場合は、bad_requestエラーを返します。

ユーザーが、変更不可ポリシーの期間を短縮しようとする場合または変更不可ポリシーを変更可能ポリシーに変換しようとする場合にエラーを返します。注: ポリシー期間の延長は許可されています。

指定した名前を持つリテンションポリシーがすでに存在する場合は、エラーを返します

予期しないクライアントエラー。

put
リテンションポリシーを更新
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

cURL
curl -i -X PUT "https://api.box.com/2.0/retention_policies/982312" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "disposition_action": "permanently_delete"
     }'
.NET
var updates = new BoxRetentionPolicyRequest()
{
    PolicyName = "New Policy Name"
};
BoxRetentionPolicy updatedPolicy = await client.RetentionPoliciesManager
    .UpdateRetentionPolicyAsync("11111", updates);
Java
BoxRetentionPolicy policy = new BoxRetentionPolicy(api, id);
BoxRetentionPolicy.Info policyInfo = policy.new Info();
policyInfo.setPolicyName("new policy name");
policy.updateInfo(policyInfo);
Python
policy_update = {'policy_name': 'New Policy Name',}
updated_retention_policy = client.retention_policy(retention_id='12345').update_info(data=policy_update)
print(f'Retention Policy ID is {updated_retention_policy.id} and the new policy name is {updated_retention_policy.policy_name}')
Node
client.retentionPolicies
	.update('123456789', { status: 'retired' })
	.then((policy) => {
		/* policy -> {
			type: 'retention_policy',
			id: '123456789',
			policy_name: 'Tax Documents',
			policy_type: 'indefinite',
			retention_length: 'indefinite',
			retention_type: 'modifiable',
			description: 'Policy to retain all reports',
			disposition_action: 'remove_retention',
			can_owner_extend_retention: false,
			status: 'retired',
			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' }
		*/
	});
iOS
client.retentionPolicy.update(policyId: "1234", name: "New Policy Name") { result in
    guard case let .success(retentionPolicy) = result else {
        print("Error updating a retention policy")
        return
    }
    
    print("Updated retention policy: \(retentionPolicy.id)")
}

レスポンスの例

{
  "id": "12345",
  "type": "retention_policy",
  "are_owners_notified": false,
  "assignment_counts": {
    "enterprise": 1,
    "folder": 1,
    "metadata_template": 1
  },
  "can_owner_extend_retention": false,
  "created_at": "2012-12-12T10:53:43-08:00",
  "created_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "custom_notification_recipients": [
    {
      "id": "11446498",
      "type": "user",
      "name": "Aaron Levie",
      "login": "ceo@example.com"
    }
  ],
  "description": "Policy to retain all reports for at least one month",
  "disposition_action": "permanently_delete",
  "modified_at": "2012-12-12T10:53:43-08:00",
  "policy_name": "Some Policy Name",
  "policy_type": "finite",
  "retention_length": "365",
  "retention_type": "non_modifiable",
  "status": "active"
}