リテンションポリシーのリストを取得

get
https://api.box.com/2.0
/retention_policies

会社のすべてのリテンションポリシーを取得します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

クエリパラメータ

stringクエリ内省略可能
21312321

ポリシーを作成したユーザーのIDのみに結果を絞り込みます。

string arrayクエリ内省略可能
id,type,name

レスポンスに含める属性のコンマ区切りリスト。このパラメータを使用すると、標準のレスポンスには通常含まれないフィールドをリクエストできます。

このパラメータを指定すると、明示的に指定しない限り標準フィールドはレスポンスに含まれず、リクエストしたフィールドのほかには、Mini版の表示のフィールドしか返されないことに注意してください。

integer / int64クエリ内省略可能
10001000

返す項目の1ページあたりの最大数。

stringクエリ内省略可能
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

結果が返される開始位置のマーカー。マーカーベースのページ割りを使用している場合に使用されます。

stringクエリ内省略可能
Sales Policy

指定したプレフィックスを持つリテンションポリシー名のみに結果を絞り込みます。このフィルタでは大文字と小文字が区別されます。

stringクエリ内省略可能
finite

指定したタイプのリテンションポリシーのみに結果を絞り込みます。

次の値のいずれか1つ: finite,indefinite

レスポンス

企業のリテンションポリシーのリストを返します。

存在しないpolicy_typeが指定された場合は、bad_requestを返します。

created_by_user_idで指定されたユーザーが存在しない場合は、not_foundエラーを返します。

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

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

リクエストの例

cURL
curl -i -X GET "https://api.box.com/2.0/retention_policies" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxCollectionMarkerBased<BoxRetentionPolicy> policies = await client.RetentionPoliciesManager
    .GetRetentionPoliciesAsync();
Java
Iterable<BoxRetentionPolicy.Info> policies = BoxRetentionPolicy.getAll(api);
for (BoxRetentionPolicy.Info policyInfo : policies) {
	// Do something with the retention policy.
}
Python
retention_policies = client.get_retention_policies()
for policy in retention_policies:
    print(f'The policy ID is {policy.id} and the name is {policy.policy_name}')
Node
client.retentionPolicies.getAll({ policy_name: 'Tax' }).then((policies) => {
	/* policies -> {
			entries:
			[ { type: 'retention_policy',
				id: '123456789',
				name: 'Tax Documents' } ],
			limit: 100,
			next_marker: 'someMarkerString' }
		*/
});
iOS
let iterator = client.retentionPolicy.list(type: .indefinite)
iterator.next { results in
    switch results {
    case let .success(page):
        for policy in page.entries {
            print("Retention policy \(policy.id)")
        }
        
    case let .failure(error):
        print(error)
    }
}

レスポンスの例

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