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:
- Create a new project.
- For the purpose of this example we will add a public file by accessing the Public files tab and searching for
- Copy the file to your project. In addition:
- The DRS ID is equal to the file ID on the Seven Bridges Platform (5dc018a9e4b0bf4ae31e92fc for this one).
- The file ID is an integral part of the URL once you access the page with file details).
- The DRS endpoint is https://cavatica-ga4gh-api.sbgenomics.com/ga4gh/drs/v1/
- Obtain the authentication token from: https://cavatica.sbgenomics.com/developer#token and include it in the API call.
- 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.
- Perform the API call for obtaining the URL using the '
'$ 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.
- Download the file.