Description

Returns information on files that meet the search query. The search query can contain one or more parameters. Keep the following in mind.

  • The search query only retrieves the latest version of a file.
  • The search query applies boolean AND logic. Every additional parameter added to the query adds an AND param to the search query. This includes custom tags and custom metadata, as well as each additional tag or metadata key.

Authentication

Pass authentication information in the header. You will need the JSON Web Token (JWT) and the name of the organization to authenticate. For more information, see https://developers.tetrascience.com/reference/authentication.

Responses

Responses are in JSON Format.

200 OK

Request was successful. Results can include what is in the following table.

ParameterDescriptionType
fromResults were retrieved starting with the array index specified. By default, files are retrieved from the start of the array (index number 0). Pairing this with the size parameter allows you to see a subset of results.number
sizeIndicates the number of results to return. By default, information for all files matching the query is returned. Pairing this with the from parameter allows you to see a subset of results.number
sortSorts the results by file creation date. Values are desc (descending), asc (ascending).string
hasNextIndicates whether other files that matched the search query were found but not included in the search results. This usually happens when you’ve used from and size to restrict the size of the query. Values are true, false.boolean
hitsContains the search results.mixed (string, uuid)
orgSlugName of your organization.string
fileIdUUID for the file in the data lake.uuid
traceIdUUID generated when the RAW file is first uploaded to the data lake. All files derived from the RAW file, such as an IDS file, have the same traceId.uuid
rawFileIdUUID for the RAW file that this file was generated from.uuid
categoryFile category. Values are RAW, IDS, and PROCESSED.string
idsName, type, and version of the schema used to create the IDS file. Format is {namespace}/{idsType}:{idsVersion}string
filePathPath to the IDS JSON file.date
createdAtDate and time that the file was created. Note that the date/timestamp is in Zulu (UTC) time.date
integrationTetrascience integrates with many different products, such as Box, Dotmatics, and DataHub. The response contains the integration type, file type that is produced, the source, source type, integration ID and source ID.uuid, string
integration.idID for the integration.uuid
integration.typeIntegration type. Values are EGNYTE, BOX, DOTMATICS, HRB CELLARIO, DATAHUB, PIPELINE, RAW, and API.string
integration.nameIntegration name.string
integration.workflowId (Added version TDP 3.1.0)Workflow ID for the pipelinestring
integration.masterScript (Added version TDP 3.1.0)Name of the pipeline protocol used.string
integration.taskScript (Added version TDP 3.1.0)**(Added version TDP 3.1.0)Name of the task script for the pipeline.string
integration.taskSlug (Added version TDP 3.1.0)Name of the slug for the task.string
integration.taskExecutionId (Added version TDP 3.1.0)Execution ID.string
sourceIndicates the source of the file. This is typically the source ID, the name of an instrument that generated the data, and a brief description of the file data.mixed (string, uuid)
source.idID for the source.uuid
source.typeType of source, which is typically the name of the instrument or other lab equipment used to generate the data or report.string
source.nameName of the source.string
fileProvides file location information including the bucket, path, checksum, size, type, and version.mixed (string, number, array)
file.bucketName of the data lake S3 bucket the file is assigned to.array
file.pathPath to the data lake S3 bucket where the file is stored, starting with the organization’s root directory.string
file.checksumChecksum (number of bits used to verify file integrity) assigned by the data lake S3 bucket.string
file.sizeSize of the file.number
file.typeType of file.string
file.versionFile version’s ID.uuid
metadataLists metadata, if present. Metadata could include items like the instrument or other lab equipment used to create the file and/or custom metadata the user added to the file (if any).array of strings
tagsLists tags that the user added to the file.array
deletedIndicates whether the file was deleted. Values are TRUE, FALSE.boolean
outdatedIndicates whether there is at least one newer version of the file available. If a newer version is available, outdated is set to TRUE. Values are TRUE, FALSE.boolean

401 Unauthorized

There is a problem with authorization. See https://developers.tetrascience.com/reference/authentication for more details.

500 Internal Server Error

There is a problem with the website’s server or there is a network issue.

Additional Examples

Search for Files by Category

Files in the data lake are categorized as RAW, IDS, or PROCESSED. Adding the category parameter to your search query can speed up your search and provide more targeted results. Note that when RAW files are processed, source as well as custom tags and metadata, remain the same for the resulting IDS file. The following fetches IDS files.

curl --location --request POST 'https://api.tetrascience.com/v1/fileinfo/search' \
--header 'ts-auth-token: {jwt token}' \
--header 'x-org-slug: tetrascience' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'category=IDS'

Search for File Created after a Specific Date

Use the fromDate parameter to search for all files created after a certain date. The following fetches all RAW files created on or after November 1, 2020.

curl --location --request POST 'https://api.tetrascience.com/v1/fileinfo/search' \
--header 'ts-auth-token: {jwt token}' \
--header 'x-org-slug: tetrascience' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'fromDate=2020-11-01T00:00:00.000Z'

Search for Files by Date Range to Narrow Search Results

Sometimes when you search, many results are returned. To better target your results and speed up searching, use fromDate and toDate parameters to only fetch information about files created within a specific date range. In the following example, information about IDS files that were created between November 1 - 15, 2020 are retrieved.

curl --location --request POST 'https://api.tetrascience.com/v1/fileinfo/search' \
--header 'ts-auth-token: {jwt token}' \
--header 'x-org-slug: tetrascience' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'fromDate=2020-11-01T00:00:00.000Z' \
--data-urlencode 'toDate=2020-11-15T00:00:00.000Z'

Search for Pending Unprocessed Files (Pre-Tagged)

To search for files that will be processed by a third-party system, use the tag parameter to search for files tagged as pending. The following example searches for files created on or after November 1, 2020 that have pending in the metadata tags.

curl --location --request POST 'https://api.tetrascience.com/v1/fileinfo/search' \
--header 'ts-auth-token: {jwt token}' \
--header 'x-org-slug: tetrascience' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'tags=pending' \
--data-urlencode 'fromDate=2020-11-01T00:00:00.000Z' \
--data-urlencode 'toDate=2020-11-15T00:00:00.000Z'

Search for Files Without a Specific Tag

To search for files without a specific tag, use the excludeTags parameter. The following command finds files without created on or after November 1, 2020 that have not completed processing.

curl --location --request POST 'https://api.tetrascience.com/v1/fileinfo/search' \
--header 'ts-auth-token: {jwt token}' \
--header 'x-org-slug: tetrascience' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'excludeTags=complete' \
--data-urlencode 'fromDate=2020-11-01T00:00:00.000Z'

Paginating Results

One way to chunk a large result set is to paginate with the from and size parameters. from indicates where the resultset begins. Note that the resultset is ordered by date. size indicates how many results to fetch per request. The following command retrieves information about 15 IDS files, starting with the 10th result of the unfiltered, complete resultset.

curl --location --request POST 'https://api.tetrascience.com/v1/fileinfo/search' \
--header 'ts-auth-token: {jwt token}' \
--header 'x-org-slug: tetrascience' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'category=IDS' \
--data-urlencode 'from=10' \
--data-urlencode 'size=15'

Search by IDS Type and Version

To find files for a specific IDS type and version, use the ids parameter. The format is {namespace}/{slug}:{version}. In the following example, information for files with the following ids type and version is retrieved: common/test-empower:v3.0.0.

curl --location --request POST 'https://api.tetrascience.com/v1/fileinfo/search' \
--header 'ts-auth-token: {jwt token}' \
--header 'x-org-slug: tetrascience' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'ids=common/test-empower:v3.0.0'

Note: To find a value, use the data lake schemas API, which can be found here: https://developers.tetrascience.com/reference/list-schemas.

Find All Files Generated by a Specific Pipeline Workflow and Pipeline ID

(Added version TDP 3.1.0) To find files generated by a specific workflow, use the workflowId parameter. In the following example, information for files with the workflowId b1909267-5a95-401c-879f-ee659c534a7f and pipelineId 495b386d-16e7-40fb-bdb7-670e5f8071a9 are retrieved.

curl --location --request POST 'https://api.tetrascienc.com/v1/fileinfo/search' \
--header 'ts-auth-token: {JWT Token}' \
--header 'x-org-slug: tetrascience' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'pipelineId=495b386d-16e7-40fb-bdb7-670e5f8071a9' \
--data-urlencode 'workflowId=b1909267-5a95-401c-879f-ee659c534a7f'
Language
Authentication
Click Try It! to start a request and see the response here!