List files (secondary method)

This call lists the files in the specified project. It is an alias for the call list files and redirects to that path.

❗️

Alias call

Note that since this is an alias for another call, the call cannot be made directly from all applications. In particular, to send the call using cURL, use the cURL option -L to redirect the path of this call to https://api.sbgenomics.com/v2/files?{project_owner}/{project}.

Alternatively, to list all files, you can simply use the call list files.

Request

https://api.sbgenomics.com/v2/projects/{project_owner}/{project}/files
https://eu-api.sbgenomics.com/v2/projects/{project_owner}/{project}/files

👍

Referring to your project

Note that project_owner is always case-sensitive, and that project is not the project's name but its ID, or short name. For more information about identifying objects in the API, see the section on identifying objects.

Example request

GET /v2/projects/rfranklin/my-project/files HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
curl -L "https://api.sbgenomics.com/v2/files?RFranklin/my-project"  -s -H "X-SBG-Auth-Token: 7942f56901534434a054dafc3813bc96" -H "content-type: application/json" -X GET "https://api.sbgenomics.com/v2/projects/rfranklin/my-project/files"
from sevenbridges import Api

api = Api(url='https://api.sbgenomics.com/v2',
          token='3259c50e1ac5426ea8f1273259740f74')

project = api.projects.get(id='rfranklin/my-project')

# send GET request to SB API
files = project.get_files()

for file in files:
    print(file.id, file.name)

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Path parameters

Name

Description

project

The short name of the project you are querying.

project_owner

The owner of the project you are querying.

📘

List files in the Public Reference Files repository

The Seven Bridges Public Reference Files repository is specified in the same way as a project on the Platform by an id of admin/sbg-public-data. You can pass this query parameter using project=admin/sbg-public-data.

Query parameters

Name

Data type

Description

fields

string

Selector specifying a subset of fields to include in the response.

Response

See a list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.

Example response body

{
  "href": "https://api.sbgenomics.com/v2/files/?offset=0&limit=25&project=rfranklin/my-project",
  "items": [
    {
      "href": "https://api.sbgenomics.com/v2/files/568cf5dce4b0307bc0462060",
      "id": "568cf5dce4b0307bc0462060",
      "name": "my_reference.vcf",
      "project": "rfranklin/my-project"
    },
    {
      "href": "https://api.sbgenomics.com/v2/files/566aad1de4b0c560b469ea80",
      "id": "566aad1de4b0c560b469ea80",
      "name": "_1_unsorted.bam",
      "project": "rfranklin/my-project"
    },
    {
      "href": "https://api.sbgenomics.com/v2/files/568cf5f4e4b0307bc0462062",
      "id": "568cf5f4e4b0307bc0462062",
      "name": "unsorted.bam",
      "project": "rfranklin/my-project"
    }
  ],
  "links": []
}