Search documentation
karat

+

K

User Documentation ↗

Get File Content

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

Gets the content of a File contained in a Dataset. By default this retrieves the file's content from 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 get a file's content from a specific Branch specify the Branch's identifier as branchId. This will retrieve the content for the most recent version of the file since the latest snapshot transaction, or the earliest ancestor transaction of the branch if there are no snapshot transactions.

To get a file's content from the resolved view of a transaction specify the Transaction's resource identifier as endTransactionRid. This will retrieve the content for the most recent version of the file since the latest snapshot transaction, or the earliest ancestor transaction if there are no snapshot transactions.

To get a file's content from 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 retrieve the content for the most recent version of the file 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 get a file's content from a specific transaction specify the Transaction's resource identifier as both the startTransactionRid and endTransactionRid.

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 that contains the File.

filePath
string

The File's path within the Dataset.

Query parameters

branchId
string
optional

The identifier (name) of the Branch that contains the File. 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.

Response body

body
string

Examples

Request

Copied!
1 2 3 curl \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v1/datasets//files/q3-data%2fmy-file.csv/content?branchId=&startTransactionRid=&endTransactionRid="