Box Developerドキュメント
最新バージョン

リーガルホールドポリシーを更新

put
https://api.box.com/2.0
/legal_hold_policies/:legal_hold_policy_id

このエンドポイントはバージョン2024.0です。引き続き使用するために 変更は必要ありません。詳細については、 **Box APIのバージョン管理**を参照してください。

リーガルホールドポリシーを更新します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

パスパラメータ

リクエスト本文

string本文内省略可能
"A custom policy for the sales team"
500

ポリシーの説明。

string本文内省略可能
"Sales Policy"
254

ポリシーの名前。

string本文内省略可能
"Required for GDPR"
500

ポリシーが解除された理由に関するメモ。

レスポンス

新しいリーガルホールドポリシーオブジェクトを返します。

この名前のポリシーがすでに存在する場合は、エラーを返します。

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

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

リクエストの例

Box SDKのバージョン戦略の詳細については、 **こちら**を確認してください。


cURL
curl -i -X PUT "https://api.box.com/2.0/legal_hold_policies/324432" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "policy_name": "Policy 4"
     }'
Node/TypeScript v10
await client.legalHoldPolicies.updateLegalHoldPolicyById(legalHoldPolicyId, {
  requestBody: {
    policyName: updatedLegalHoldPolicyName,
  } satisfies UpdateLegalHoldPolicyByIdRequestBody,
} satisfies UpdateLegalHoldPolicyByIdOptionalsInput);
Python v10
client.legal_hold_policies.update_legal_hold_policy_by_id(
    legal_hold_policy_id, policy_name=updated_legal_hold_policy_name
)
.NET v10
await client.LegalHoldPolicies.UpdateLegalHoldPolicyByIdAsync(legalHoldPolicyId: legalHoldPolicyId, requestBody: new UpdateLegalHoldPolicyByIdRequestBody() { PolicyName = updatedLegalHoldPolicyName });
Swift v10
try await client.legalHoldPolicies.updateLegalHoldPolicyById(legalHoldPolicyId: legalHoldPolicyId, requestBody: UpdateLegalHoldPolicyByIdRequestBody(policyName: updatedLegalHoldPolicyName))
Java v10
client.getLegalHoldPolicies().updateLegalHoldPolicyById(legalHoldPolicyId, new UpdateLegalHoldPolicyByIdRequestBody.Builder().policyName(updatedLegalHoldPolicyName).build())
Java v4
BoxLegalHoldPolicy policy = new BoxLegalHoldPolicy(api, id);
BoxLegalHoldPolicy.Info policyInfo = policy.new Info();
info.setDescription("new description");
info.setPolicyName("new policy name");
policy.updateInfo(info);
Python v3
policy_update = {'description': 'New Description', 'release_notes': 'Example Notes'}
updated_policy = client.legal_hold_policy(policy_id='12345').update_info(data=policy_update)
.NET v5
var updates = new BoxLegalHoldPolicyRequest()
{
    Description = "Hold for documents related to the IRS audit"
};
BoxLegalHoldPolicy updatedPolicy = await client.LegalHoldPoliciesManager
    .UpdateLegalHoldPolicyAsync("11111", updates);
Node v3
client.legalHoldPolicies.update('11111', {description: 'Documents related to IRS audit'})
	.then(policy => {
		/* policy -> {
			type: 'legal_hold_policy',
			id: '11111',
			policy_name: 'IRS Audit',
			description: 'Documents related to IRS audit',
			status: 'active',
			assignment_counts: { user: 1, folder: 0, file: 0, file_version: 0 },
			created_by: 
			{ type: 'user',
				id: '22222',
				name: 'Example User',
				login: 'user@example.com' },
			created_at: '2016-05-18T10:28:45-07:00',
			modified_at: '2016-05-18T11:25:59-07:00',
			deleted_at: null,
			filter_started_at: '2016-05-17T01:00:00-07:00',
			filter_ended_at: '2016-05-21T01:00:00-07:00' }
		*/
	});

レスポンスの例

{
  "id": "11446498",
  "type": "legal_hold_policy",
  "assignment_counts": {
    "file": 3,
    "file_version": 4,
    "folder": 2,
    "user": 1
  },
  "created_at": "2012-12-12T10:53:43-08:00",
  "created_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "deleted_at": "2012-12-12T10:53:43-08:00",
  "description": "Postman created policy",
  "filter_ended_at": "2012-12-12T10:53:43-08:00",
  "filter_started_at": "2012-12-12T10:53:43-08:00",
  "modified_at": "2012-12-12T10:53:43-08:00",
  "policy_name": "Policy 4",
  "release_notes": "Example",
  "status": "active"
}