ファイルバージョンリテンションのリストを取得

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

指定した会社のすべてのファイルバージョンリテンションを取得します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

クエリパラメータ

stringクエリ内省略可能
permanently_delete

この廃棄アクションを使用するリテンションポリシーのみに結果を絞り込みます。

次の値のいずれか1つ: permanently_delete,remove_retention

stringクエリ内省略可能
2012-12-19T10:34:23-08:00

この日付の後で廃棄が有効になるファイルのみに結果を絞り込みます。

stringクエリ内省略可能
2012-12-12T10:53:43-08:00

この日付の前に廃棄が有効になるファイルのみに結果を絞り込みます。

stringクエリ内省略可能
43123123

このIDを持つファイルのみに結果を絞り込みます。

stringクエリ内省略可能
1

このIDを持つファイルバージョンのみに結果を絞り込みます。

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

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

stringクエリ内省略可能
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

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

これを使用するには、usemarkertrueに設定する必要があります。

stringクエリ内省略可能
982312

このIDを持つリテンションポリシーのみに結果を絞り込みます。

レスポンス

会社のすべてのファイルバージョンリテンションのリストを返します。

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

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

リクエストの例

cURL
curl -i -X GET "https://api.box.com/2.0/file_version_retentions" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxCollectionMarkerBased<BoxFileVersionRetention> retentions = await client.RetentionPoliciesManager
    .GetFileVersionRetentionsAsync();
Java
BoxFileVersionRetention.QueryFilter filter = new BoxFileVersionRetention.QueryFilter()
                .addFileID("0")
                .addFileVersionID("1")
                .addPolicyID("2")
                .addDispositionAction(BoxRetentionPolicy.ACTION_PERMANENTLY_DELETE)
                .addDispositionBefore(BoxDateFormat.parse("2016-09-15T13:15:35+0000"))
                .addDispositionAfter(BoxDateFormat.parse("2014-09-15T13:15:35+0000"));
Iterable<BoxFileVersionRetention.Info> retentions
                = BoxFileVersionRetention.getRetentions(api, filter, "file", "applied_at");
for (BoxFileVersionRetention.Info retentionInfo : retentions) {
	// Do something with the file version retention.
}
Python
retentions = client.get_file_version_retentions()
for retention in retentions:
    print(f'The file version retention ID is {retention.id} and the data time applied at is {retention.applied_at}')
Node
// Get only the retention records set to delete items before a certain date
var options = {
	disposition_action:
		client.retentionPolicies.dispositionActions.PERMANENTLY_DELETE,
	disposition_before: '2038-01-01T12:34:56-08:00',
};
client.retentionPolicies
	.getAllFileVersionRetentions(options)
	.then((retentions) => {
		/* retentions -> {
			entries:
			[ { type: 'file_version_retention', id: '112725' },
				{ type: 'file_version_retention', id: '112729' },
				{ type: 'file_version_retention', id: '112733' } ],
			limit: 100,
			order: [ { by: 'file_version_id', direction: 'ASC' } ] }
		*/
	});
iOS
let iterator = client.files.listVersionRetentions()
iterator.next { results in
    switch results {
    case let .success(page):
        for retention in page.entries {
            print("File version retention \(retention.id)")
        }
        
    case let .failure(error):
        print(error)
    }
}

レスポンスの例

{
  "entries": [
    {
      "id": "11446498",
      "type": "file_version_retention",
      "file_version": {
        "id": "12345",
        "type": "file_version",
        "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
      },
      "file": {
        "id": "12345",
        "etag": "1",
        "type": "file",
        "sequence_id": "3",
        "name": "Contract.pdf",
        "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
        "file_version": {
          "id": "12345",
          "type": "file_version",
          "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
        }
      },
      "applied_at": "2012-12-12T10:53:43-08:00",
      "disposition_at": "2012-12-12T10:53:43-08:00",
      "winning_retention_policy": {
        "id": "12345",
        "type": "retention_policy",
        "policy_name": "Some Policy Name",
        "retention_length": "365",
        "disposition_action": "permanently_delete"
      }
    }
  ],
  "limit": 1000,
  "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
  "prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih"
}