Download a DRS object (file) tutorial

This tutorial will demonstrate how you can download an example file via DRS API. You can download any type of file, public or controlled, as long as:

  • it resides in your project
  • you have copy permission
  • and proper authorization

To download a file using DRS API:

  1. Create a new project.
  2. For the purpose of this example we will add a public file by accessing the Public files tab and searching for example_human_reference.fasta.
  3. Copy the file to your project. In addition:
  1. Obtain the authentication token from: https://cavatica.sbgenomics.com/developer#token and include it in the API call.
  2. Perform the API call:
'$ curl -H "X-SBG-Auth-Token: <token>" 'https://cavatica-ga4gh-api.sbgenomics.com/ga4gh/drs/v1/objects/5d728923e4b09cae86687385'

The response will contain the access_id parameter, which you will use within the API call for retrieving the URL for downloading the file.

  1. Perform the API call for obtaining the URL using the 'access_id.
'$ curl -H "X-SBG-Auth-Token: <token>" 'https://cavatica-ga4gh-api.sbgenomics.com/ga4gh/drs/v1/objects/5d728923e4b09cae86687385/access/aws-us-east-1'

The response will contain the URL for downloading the file.

  1. Download the file.