Get file details

This call returns details about a specified file. The call returns the file's name, its tags, and all of its metadata.

Files are specified by their IDs, which you can obtain by making the API call to list files in a project.

Learn more about metadata fields and their values on the Seven Bridges Platform. You can also learn more about working with tags on the Platform.

Request

https://api.sbgenomics.com/v2/files/{file_id}
https://eu-api.sbgenomics.com/v2/files/{file_id}

Example request

GET /v2/files/562e449060b274321afb6091 HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 565357a1e4b09c884b29334a
curl  -s -H "X-SBG-Auth-Token: 6282d5e2121d43e7900e9d52b15845e7" -H "content-type: application/json" -X GET "https://api.sbgenomics.com/v2/files/565357a1e4b09c884b29334a"
from sevenbridges import Api

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

# send GET request to SB API
file = api.files.get(id='562e449060b274321afb6091')

print(file.name, file.tags, file.metadata)

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Path parameters

Name

Description

file_id

The ID of the file whose details you want to GET.

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/566aad1de4b0c560b469ea80",
  "id": "566aad1de4b0c560b469ea80",
  "name": "_1_1000G_phase1.snps.high_confidence.b37.vcf",
  "size": 363,
  "project": "RFranklin/my-project",
  "created_on": "2015-12-11T11:01:49Z",
  "modified_on": "2015-12-11T11:01:49Z",
  "storage": {
        "type": "VOLUME",
        "volume": "rfranklin/my_volume_s3",
        "location": "bemo/demo_omed"
  },
  "origin": {},
  "metadata": {
    "file_type": "vcf",
    "file_extension": "VCF"
  },
  "tags": [
    "my first files",
    "test 1b",
    "big sample"
  ]
}
Interpreting the response body:
  • The object storage denotes the type of storage for the file which can be either PLATFORM or VOLUME depending on where the file is stored.
  • The object origin denotes the task that produced the file, if it was created by a task on the Seven Bridges Platform.
  • The dictionary object metadata lists the metadata fields and values for the file.
  • The object tags lists the tags for the file. Learn more about tagging your files on the Platform.