LogoLogo
Illumina KnowledgeIllumina SupportSign In
  • Home
  • Get Started with Emedgene
    • Get started with Emedgene
    • How can Emedgene help you solve a case?
  • Emedgene analyze manual
    • Getting around the platform
      • Top navigation panel
      • Emedgene Applications menu
      • Dashboard
      • Settings
      • User roles
      • Help
      • Okta identity management
    • Managing data storage
      • Manage data storages
      • Manage Azure Blob data storage
      • Manage S3 credentials
      • Manage BaseSpace storage
      • Manage GCS storage (V37.0+)
      • Bring Your Own Bucket
      • Bring Your Own Key
    • Cases tab
      • Cases tab
      • Cases table
      • Case status
      • Browse and select cases
      • Case details
    • Creating a single case
      • Add a new case
      • Select sample type
      • Create a family tree
      • Family tree legend
      • Add a sample
      • Supported Variant callers
      • Adding patient info for the proband
      • Adding patient info for the non-proband samples
      • Secondary findings
      • Labeling a case
      • Gene list
      • Supported parental ethnicities
    • Creating multiple cases
      • Batch case upload from platform
      • CSV format requirements
      • Batch case upload via CLI
    • Reviewing a case
      • Individual case page
      • Individual case page: Top bar
      • Individual case page: Top bar
      • Candidates tab
      • Most Likely Candidates and Candidates
      • Genome Overview
      • Analysis tools tab
      • Variant table columns
      • Variant table
      • Variant search
      • Multiselection of variants and bulk actions (34.0+)
      • Download variants
      • Manually add variants to a delivered case
      • Filters/Presets panel
      • Filters
      • Presets
      • Preset groups
      • Variant Type Filters
      • Variant Effect Filters
      • Quality Filters
      • Polymorphism Filters
      • Gene Filters
      • Phenomatch Filters
      • Inheritance Filters
      • Zygosity Filters
      • User Filters
      • Evidence page
      • Phenotypic match strength
      • Lab tab
      • Versions tab
      • Editing an existing case
      • Finalizing a case
      • Clinical Report
      • Reflex genetic testing
      • Variant zygosity notations
      • STR calling and interpretation
    • Variant page
      • Variant page
      • Variant page top bar
      • Variant tagging widget
      • Variant activity panel
      • Desktop apps panel
      • Clinical Significance section
      • Summary section
      • Quality section
      • Visualization section
      • Population Statistics section
      • Related Cases section
      • CNV overlap percentage
      • Evidence section
      • ACMG SNV Classification wizard
      • Logic behind ACMG classification of SNVs
      • ACMG CNV Classification wizard
      • Variant page sidebar (2.29+)
    • Variant visualization setup
      • Enabling visualization for a VCF case
      • Integration between emedgene and desktop IGV
      • Loading alignment files to your desktop IGV (32.0+)
    • Analyze Network
      • Analyze Network Setup
      • Network sharing configuration
      • Case subject consent for extended sharing
      • Public vs Private network
      • Create a network
      • Set network data sharing policy
      • Leave a network
      • Delete a network
    • Settings
      • My settings
      • Management
      • User Management
      • Network
      • Organization Settings (33.0+)
    • Integrations
      • API Beginner Guide
      • Advanced API Implementations
      • API Key Generation
      • BSSH Integration
      • ICA Integration
      • Webhook Integration
  • Emedgene Curate Manual
    • Curate overview
      • Curate overview
      • Emedgene Applications menu
      • Curate navigation panel
      • Genome assemblies supported by Curate
    • Curate Variants
      • Curate Variants overview
      • Curate Variant table
      • Curate Variant page
      • How to add a variant to Curate
      • Curate Variant annotations in the case
    • Curate Genes (2.28+)
      • Curate Genes overview
      • Curate Gene table
      • Curate Gene page
      • How to add a gene to Curate
    • Import Curate annotations to the case (30.0+)
      • Import Curate Variant annotations to the case (30.0+)
      • Import Curate Gene annotations to the case (30.0+)
  • Frequently Asked Questions
    • All FAQ
      • Which browser should I use with Emedgene?
      • Emedgene annotations and update frequency
      • How do I use developer tools to collect logs?
      • Can I analyze Illumina Complete Long Reads in Emedgene?
      • How do I prepare VCF files generated by DRAGEN MANTA to be used as input for Emedgene?
      • Source of gnomAD data for small variants on GRCh38
      • How are MNVs handled on the platform?
      • Support for gene lists with up to 10,000 genes
      • Genomic Regions by Case Type
      • How do I analyze mtDNA variants?
      • Can I use exome data for CNV detection?
      • How does joint calling work on Emedgene?
      • What is the required format for a BED file defining a kit?
      • Which reference genomes can I use?
      • How do I move between organizations?
      • How do I check the version of my environment?
      • "Failed to generate report". What should I do?
      • How do I prepare VCF files generated by Dragen STR (ExpansionHunter) to be used as input?
      • How does Emedgene Analyze prioritize transcripts?
      • How does Emedgene Analyze merge variants from different sources?
      • Performance issue troubleshooting
      • How does Emedgene calculate variant effect and severity ?
      • How to I prepare metrics files generated by DRAGEN to be used as input for Emedgene
      • How are timekeeping and log timestamps kept accurate and consistent?
  • Release Notes
    • Workbench & Pipeline Updates
      • New in Emedgene V37.0 (February 20, 2025)
        • V37 Patches
      • New in Emedgene V36.0 (October 8 2024)
        • V36 Patches
      • New in Emedgene V35.0 (May 22nd 2024)
        • V35 Patches
      • New in Emedgene V34.0 (January 28th 2024)
        • V34 Patches
      • New in Emedgene V33.0 (September 6th 2023)
        • V33 Patches
      • New in Emedgene V32.0 (June 8th 2023)
        • New pipeline 32 (June 8th 2023)
        • V32 Patches
      • More release notes
        • New in emedgene 31 (March 1st 2023)
        • New in emedgene 30 (January 8th 2023)
        • New in emedgene 2.29 (August 25 2022)
        • New pipeline 5.29 (May 1st 2022)
        • New in emedgene 2.28 (May 1 2022)
        • New in emedgene 2.27 (March 7, 2022)
        • New in emedgene 2.26 (Dec 14, 2021)
        • New in emedgene 2.24-2.25 (Aug 11, 2021)
        • New in emedgene 2.23 (Jun 15, 2021)
        • New in emedgene 2.19-2.22 (Apr 8, 2021)
        • New in emedgene 2.16-2.19 (Dec 7, 2020)
        • New in emedgene 2.12-2.16 (Oct 18, 2020)
    • Knowledgebase Updates
      • 2025
        • Variant Databases (March 30th 2025)
        • Zoidberg 77 (March 17th 2025)
        • Zoidberg 76 (February 3rd 2025)
        • Zoidberg 75 (January 6th 2025)
      • 2024
        • Variant Databases (December 8th 2024)
        • Zoidberg 74 (December 2nd 2024)
        • Zoidberg 73 (October 21th 2024)
        • Variant Databases (September 22nd 2024)
        • Zoidberg 72 (September 10th 2024)
        • Variant Databases (July 21st 2024)
        • Zoidberg 71 (July 24th 2024)
        • Zoidberg 70 (June 3rd 2024)
        • Zoidberg 69 (April 19th 2024)
        • Variant Databases (April 9th 2024)
        • Zoidberg 68 (March 18th 2024)
        • Variant Databases (February 5th 2024)
        • Zoidberg 67 (January 28th 2024)
        • Variant Databases (January 5th 2024)
      • 2023
        • Zoidberg 66 (December 24th 2023)
        • Variant Databases (December 3rd 2023)
        • Zoidberg 65 (November 21th 2023)
        • Variant Databases (November 5th 2023)
        • Zoidberg 64 (October 24th 2023)
        • Variant Databases (October 8th 2023)
        • Zoidberg 63 (September 18th 2023)
        • Variant Databases (September 5th 2023)
        • Zoidberg 62 (August 23th 2023)
        • Zoidberg 61 (August 16th 2023)
        • Variant Databases (August 6th 2023)
        • Zoidberg 60 (July 30th 2023)
        • Variant Databases (July 2nd 2023)
        • Zoidberg 59 (June 18th 2023)
        • Variant Databases (June 4th 2023)
          • Variant Databases (May 7th 2023)
        • Zoidberg 58 (May 21th 2023)
        • Zoidberg 57 (April 16th 2023)
        • Variant Databases (April 2nd 2023)
        • Zoidberg 56 (March 19th 2023)
        • Variant Databases (March 11th 2023)
        • Zoidberg 55 (February 19th 2023)
        • Zoidberg 54 (January 16th 2023)
    • Change log
      • Change log pipeline v34
      • Change log pipeline 31
      • Change log workbench 31
      • Change log pipeline 30
      • Change log workbench 30
      • Change log workbench 2.29
      • Change log pipeline 5.29
      • Change log workbench 2.28
  • Legal
    • Privacy, Security & Compliance
    • Release Policy
Powered by GitBook
On this page
  • API Introduction
  • Prerequisites
  • Authentication
  • API Reference
  • Creating Python requests from curl
  • Examples
  • Get list of cases
  • Get list of storage providers
  • Create new case
  • Check the status of a case
  • Get more information about a case
  • Get candidates of completed case

Was this helpful?

Export as PDF
  1. Emedgene analyze manual
  2. Integrations

API Beginner Guide

PreviousIntegrationsNextAdvanced API Implementations

Last updated 3 months ago

Was this helpful?

API Introduction

Any operation from the Emedgene's graphical user interface (GUI) can also be performed by using the Emedgene's API.

Following are some basic examples of how to use Emedgene's API with Python.

For instructions on using the API with other programming languages, please refer to their respective documentation.

Prerequisites

  • An installed copy of Python ()

  • The Python package installer, pip ()

  • The requests library installed (run pip install requests)

Authentication

In order to perform a secure session with Emedgene's API servers you should first accomplish the authentication phase and retrieve the bearer token. The bearer token is further required to perform API requests on associated resources without extra identification. The token is valid for a predefined time. Once the bearer token is not valid, you will need to revalidate the token and accomplish the authentication phase again.

There are two ways to get your authentication token for your user before executing API calls:

Emedgene Domain users - https://<hostname>.emedgene.com

To generate the authorization token, use your username and password as follows:

route_login_platform = 'https://<hostname>.emedgene.com/api/auth/v2/api_login/'
payload = {"username": user_name, "password": password}
response = requests.post(route_login_platform, json=payload)
access_token = response.json().get('access_token')
token_type = response.json().get('token_type')
print(f'{token_type.capitalize()} {access_token}')

This is your Bearer token that will be used for the following API requests.

Illumina Domain users - https://<hostname>.emg.illumina.com

For Illumina domain users there are two options to authenticate your user and retrieve the Bearer token.

  1. Illumina credentials - use your username and password

route_login_platform = 'https://<hostname>.emg.illumina.com/api/auth/v2/api_login/'
payload = {"username": user_name, "password": password}
response = requests.post(route_login_platform, json=payload)
access_token = response.json().get('access_token')
token_type = response.json().get('token_type')
bearer_token = f'{token_type.capitalize()} {access_token}'
print(bearer_token)
import base64

api_key = 'my-api-key'
route_token_platform = 'https://<hostname>.login.illumina.com/platform-services-manager/Token'

# Prepare the API Key
client_id_apikey = f'emedgene:{api_key}'
client_id_apikey_bytes = client_id_apikey.encode("ascii")
client_id_apikey_base64_bytes_encoded = base64.b64encode(client_id_apikey_bytes)
client_id_decoded = client_id_apikey_base64_bytes_encoded.decode("ascii")

# Use the API Key
headers = {
    'Authorization': f'Basic {client_id_decoded}'
}
params = {
    "audience": "emedgene", 
    "grant_type": "api_key"
}
response = requests.post(route_token_platform, params=params, headers=headers)

access_token = response.json().get('access_token')
token_type = response.json().get('token_type')
bearer_token = f'{token_type.capitalize()} {access_token}'
print(bearer_token)

Either of these options will produce your Bearer token that will be used for the following API requests.

API Reference

The different API commands can be found at https://<hostname>.emedgene.com/api/apidoc/swagger or https://<hostname>.emg.illumina.com/api/apidoc/swagger

It is useful to explore possible APIs and get an overview of the available parameters.

Creating Python requests from curl

The examples in the API Reference page use curl (Client URL), while Python uses requests.

In order to get the curl command:

  1. Find the endpoint you want to use on the API Reference page.

  2. Select Try it out.

  3. Enter the necessary parameters.

  4. Select Execute.

  5. Copy the resulting curl command.

Let's break down the parts of a curl command:

curl -X 'POST' 'https://<hostname>.emg.illumina.com/api/some/command/path/' 
   -H 'Authorization': 'Bearer your-auth-token'  
   -d '{"DataName": "DataValue", ...}' 

-X specifies the request method to use when communicating with the HTTP server. By default, curl performs a GET request, but you can use the -X option to set a different method, such as POST, PUT, DELETE, etc.

-H allows you to pass custom headers to the server.

-d is used to send data in a POST request to the server. This option implies using the POST method.

To translate a POST command to a Python request:

import requests
url = 'https://<hostname>.emg.illumina.com/api/some/command/path'
headers = {
    'Authorization': 'Bearer your-auth-token',
}
data = {
    'DataName': 'DataValue',
}
response = requests.post(url=url, headers=headers, json=data)

Translating a GET command would be similar:

import requests
url = 'https://<hostname>.emg.illumina.com/api/some/command/path'
headers = {
    'Authorization': 'Bearer your-auth-token',
}
response = requests.get(url=url, headers=headers)

Examples

In the examples below, <hostname>.emedgene.com and <hostname>.emg.illumina.com are used indifferently.

The following examples will build the requests step-by-step, allowing you to execute them individually to understand their functionality, using the output of one request as the input for the next.

You can also use the GUI to obtain all the parameters or record them after executing the individual API calls in this section. Then, use these values to construct your final API call.

Get list of cases

This example can be used as a simple way to verify your connection.

import requests

headers = {
    'Authorization': 'Bearer your-auth-token',
}

# Store the API response in a response variable
response = requests.get('https://<hostname>.emg.illumina.com/api/test', headers=headers)

Checking the response

To validate the API request was completed successfully, check the HTTP response code.

# Display the response status code
print(f"Response status code: {response.status_code}")

# Display the data from the request
print(response.json().get("hits"))

In order to pretty-print the JSON response and view it in a formatted way:

import json

# Print JSON data in readable format with indentation and sorting.
print(json.dumps(response.json().get("hits"), indent=3, sort_keys=True))

Tip: when returning lists (like lists of cases) Emedgene API uses pagination. It is possible to get the next items from the list using from and size, shown below.

import requests

params = {
    'from': 5,    # get the 6th case
    'size': 10    # get 10 cases
}

headers = {
    'Authorization': 'Bearer your-auth-token',
}

# Store the API response in a response variable
response = requests.get('https://<hostname>.emg.illumina.com/api/test', params=params, headers=headers)

Get list of storage providers

Now that we are able to retrieve information with the API, let's continue by using it for a more practical request like retrieving the list of storage providers your user can access files from.

Your storage provider holds the sample files accessible for creating samples in a case.

url = 'https://<hostname>.emg.illumina.com/api/storage'
headers = {
    'Authorization': 'Bearer your-auth-token',
}
response = requests.get(url, headers=headers)
print(response.json().get("hits"))

Create new case

To create a new case, multiple parameters need to be defined such as samples, the relationship between samples, phenotypes, genes and more. All the required details can be found in the API Reference page under /api/cases/v2/cases .

Once the complete JSON defining the case details is complete, the case can be created as follows:

url = 'https://<hostname>.emedgene.com/api/cases/v2/cases'
headers = {
    'Authorization': 'Bearer your-auth-token' 
}
data = {...}
response = requests.post(url, json=data, headers=headers)

Once the case was created successfully, the response code expected is HTTP 201.

Use the case name to retrieve information about the case.

case_name = response.json().get("name")

Check the status of a case

In order to know if the case has completed successfully, check the status as follows:

url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}?test_fields=status'
headers = {
    'Authorization': 'Bearer your-auth-token' 
}
response = requests.get(url, headers=headers)
print(response.json())

Get more information about a case

To get more information about a case, use the same API call as above without any test_fields

url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}'
headers = {
    'Authorization': 'Bearer your-auth-token' 
}
response = requests.get(url, headers=headers)
print(response.json())

The response can be used to find which test fields are of interest and use them in the next API calls:

url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}?test_fields=status&test_fields=participants&test_fields=patients'
headers = {
    'Authorization': 'Bearer your-auth-token' 
}
response = requests.get(url, headers=headers)
print(response.json())

Get candidates of completed case

To retrieve the candidate variants of the completed case:

url = f'https://<hostname>.emg.illumina.com/api/candidates/{case_name}'
headers = {
    'Authorization': 'Bearer your-auth-token' 
}
response = requests.get(url, headers=headers)
print(response.json().get("hits"))

To retrieve candidate variants of the completed case with details such as transcript data, pathogenicity, ACMG tags and more:

url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}/export'
headers = {
    'Authorization': 'Bearer your-auth-token' 
}
response = requests.get(url, headers=headers)
print(response.json().get("hits"))

Using your API Key to generate the authentication token. To generate an API Key take a look . Copy your API Key to the code below instead of 'my-api-key'.

HTTP 200 means the API call was successful. Learn more about HTTP response code .

https://www.python.org/
https://pip.pypa.io/
API Key Generating
here