Search documentation
karat

+

K

User Documentation ↗
Version 1.0

List Files

GET/api/v1/datasets/{datasetRid}/files

Lists Files contained in a Dataset. By default files are listed on the latest view of the default branch - master for most enrollments.

Advanced Usage

See Datasets Core Concepts for details on using branches and transactions.

To list files on a specific Branch specify the Branch's identifier as branchId. This will include the most recent version of all files since the latest snapshot transaction, or the earliest ancestor transaction of the branch if there are no snapshot transactions.

To list files on the resolved view of a transaction specify the Transaction's resource identifier as endTransactionRid. This will include the most recent version of all files since the latest snapshot transaction, or the earliest ancestor transaction if there are no snapshot transactions.

To list files on the resolved view of a range of transactions specify the the start transaction's resource identifier as startTransactionRid and the end transaction's resource identifier as endTransactionRid. This will include the most recent version of all files since the startTransactionRid up to the endTransactionRid. Note that an intermediate snapshot transaction will remove all files from the view. Behavior is undefined when the start and end transactions do not belong to the same root-to-leaf path.

To list files on a specific transaction specify the Transaction's resource identifier as both the startTransactionRid and endTransactionRid. This will include only files that were modified as part of that Transaction.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:datasets-read.

Path parameters

datasetRid
string

The Resource Identifier (RID) of the Dataset on which to list Files.

Query parameters

branchId
string
optional

The identifier (name) of the Branch on which to list Files. Defaults to master for most enrollments.

startTransactionRid
string
optional

The Resource Identifier (RID) of the start Transaction.

endTransactionRid
string
optional

The Resource Identifier (RID) of the end Transaction.

pageSize
integer
optional

The desired size of the page to be returned. Defaults to 1,000. See page sizes for details.

pageToken
string
optional

The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and use it to populate the pageToken field of the next request.

Response body

ListFilesResponse
object

A page of Files and an optional page token that can be used to retrieve the next page.

Hide child attributes

Hide child attributes

nextPageToken
string
optional

The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and use it to populate the pageToken field of the next request.

data
list<File>
optional
Show child attributes

Show child attributes

Examples

Request

Copied!
1 2 3 curl \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v1/datasets/ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da/files?branchId=master&startTransactionRid=ri.foundry.main.transaction.0a0207cb-26b7-415b-bc80-66a3aa3933f4&endTransactionRid=ri.foundry.main.transaction.0a0207cb-26b7-415b-bc80-66a3aa3933f4"

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "nextPageToken": "v1.QnVpbGQgdGhlIEZ1dHVyZTogaHR0cHM6Ly93d3cucGFsYW50aXIuY29tL2NhcmVlcnMvP2xldmVyLXNvdXJjZSU1YiU1ZD1BUElEb2NzI29wZW4tcG9zaXRpb25z", "data": [ { "path": "q3-data/my-file.csv", "transactionRid": "ri.foundry.main.transaction.bf9515c2-02d4-4703-8f84-c3b3c190254d", "sizeBytes": "74930", "updatedTime": "2022-10-10T16:44:55.192Z" }, { "path": "q2-data/my-file.csv", "transactionRid": "ri.foundry.main.transaction.d8db1cfc-9f8b-4bad-9d8c-00bd818a37c5", "sizeBytes": "47819", "updatedTime": "2022-07-12T10:12:50.919Z" }, { "path": "q2-data/my-other-file.csv", "transactionRid": "ri.foundry.main.transaction.d8db1cfc-9f8b-4bad-9d8c-00bd818a37c5", "sizeBytes": "55320", "updatedTime": "2022-07-12T10:12:46.112Z" } ] }

Error responses

Error Name
InvalidParameterCombinationError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe given parameters are individually valid but cannot be used in the given combination.
ParametersvalidCombinations, providedParameters
InvalidBranchIdError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe requested branch name cannot be used. Branch names cannot be empty and must not look like RIDs or UUIDs.
ParametersbranchId
BranchNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested branch could not be found, or the client token does not have access to it.
ParametersdatasetRid, branchId
DatasetNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested dataset could not be found, or the client token does not have access to it.
ParametersdatasetRid
TransactionNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe requested transaction could not be found on the dataset, or the client token does not have access to it.
ParametersdatasetRid, transactionRid