リーガルホールドポリシーを作成

post
https://api.box.com/2.0
/legal_hold_policies

新しいリーガルホールドポリシーを作成します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

リクエスト本文

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

ポリシーの説明。

string / date-time本文内省略可能
"2012-12-18T10:53:43-08:00"500

フィルタの終了日。

custodianのリーガルホールド割り当てを使用してこのポリシーが適用されている場合は、日付範囲内に作成またはアップロードされたファイルバージョンのみに適用されます。フォルダやファイルなど、他の割り当てタイプの場合、日付フィルタは無視されます。

is_ongoingfalseに設定されている場合は必須です。

string / date-time本文内省略可能
"2012-12-12T10:53:43-08:00"500

フィルタの開始日。

custodianのリーガルホールド割り当てを使用してこのポリシーが適用されている場合は、日付範囲内に作成またはアップロードされたファイルバージョンのみに適用されます。フォルダやファイルなど、他の割り当てタイプの場合、日付フィルタは無視されます。

is_ongoingfalseに設定されている場合は必須です。

boolean本文内省略可能
true

このポリシーに基づく新しい割り当てを初期化後のファイルにも引き続き適用するかどうか。

リーガルホールド割り当てを使用してこのポリシーを適用した場合は、ポリシーの適用後も同じポリシーが新しいファイルバージョンに引き続き適用されます。

たとえば、今日リーガルホールド割り当てをユーザーに適用し、そのユーザーが明日ファイルをアップロードした場合、そのファイルは保持されます。これは、ポリシーが撤回されるまで継続されます。

フィルタ日付が設定されていない場合は必須です。

string本文内必須
"Sales Policy"254

ポリシーの名前。

レスポンス

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

必須のパラメータが指定されていない場合や、is_ongoingもフィルタの日付も指定されていない場合は、エラーを返します。

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

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

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

リクエストの例

cURL
curl -i -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"
     }'
.NET
var policyParams = new BoxLegalHoldPolicyRequest()
{
    PolicyName = "IRS Audit"
};
BoxLegalHoldPolicy policy = await client.LegalHoldPoliciesManager
    .CreateLegalHoldPolicyAsync(policyParams);
Java
BoxLegalHoldPolicy.Info policyInfo = BoxLegalHoldPolicy.create(api, name, description, startedAt, endedAt);
Python
new_policy = client.create_legal_hold_policy('New Policy', is_ongoing=True)
print(f'Created legal hold policy with ID {new_policy.id}')
Node
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 }
		*/
	});
iOS
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)\"")
}

レスポンスの例

{
  "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"
}