Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

Get retention on file

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

Returns information about a file version retention.

Note: File retention API is now deprecated. To get information about files and file versions under retention, see files under retention or file versions under retention endpoints.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
3424234

The ID of the file version retention

Response

Returns a file version retention object.

application/jsonClient error

An unexpected client error.

get
Get retention on file
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X GET "https://api.box.com/2.0/file_version_retentions/3424234" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
TypeScript Gen
await client.fileVersionRetentions.getFileVersionRetentionById(
  fileVersionRetention.id!
);
Python Gen
client.file_version_retentions.get_file_version_retention_by_id(
    file_version_retention.id
)
.NET Gen
await client.FileVersionRetentions.GetFileVersionRetentionByIdAsync(fileVersionRetentionId: NullableUtils.Unwrap(fileVersionRetention.Id));
Swift Gen (Beta)
try await client.fileVersionRetentions.getFileVersionRetentionById(fileVersionRetentionId: fileVersionRetention.id!)
Java
BoxFileVersionRetention policy = new BoxFileVersionRetention(api, id);
BoxFileVersionRetention.Info policyInfo = policy.getInfo();
Python
retention_info = client.file_version_retention(retention_id='12345').get()
print(f'The file version retention ID is {retention.id} and the data time applied at is {retention.applied_at}')
.NET
BoxFileVersionRetention retention = await client.RetentionPoliciesManager
    .GetFileVersionRetentionAsync("55555");
Node
client.retentionPolicies.getFileVersionRetention('55555').then((retention) => {
	/* retention -> {
			type: 'file_version_retention',
			id: '55555',
			applied_at: '2015-08-06T22:02:24-07:00',
			disposition_at: '2016-08-06T21:45:28-07:00',
			winning_retention_policy:
			{ type: 'retention_policy',
				id: '11111',
				policy_name: 'Tax Documents' },
			file_version:
			{ type: 'file_version',
				id: '44444',
				sha1: '4262d6250b0e6f440dca43a2337bd4621bad9136' },
			file: { type: 'file', id: '33333', etag: '2' } }
		*/
});
iOS
client.files.getVersionRetention(retentionId: "123456"){ result in
    guard case let .success(retention) = result else {
        print("Error getting file version retention")
        return
    }
    
    print("File version retention: \(retention.id)")
}

Response Example

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