import * as React from 'react'; import { observer } from 'mobx-react'; import { observable, makeObservable } from 'mobx'; import { PageLayout } from '../../../shared/components/PageLayout/PageLayout'; import './styles.scss'; import Helmet from 'react-helmet'; import { getServerConfig } from 'config/config'; import { getBrowserWindow } from 'cbioportal-frontend-commons'; import { buildCBioPortalAPIUrl } from 'shared/api/urls'; export class UserDataAccessToken { @observable.ref token: string; @observable.ref creationDate: string; @observable.ref expirationDate: string; @observable.ref username: string; constructor( token: string, creationDate: string, expirationDate: string, username: string ) { makeObservable(this); this.token = token; this.creationDate = creationDate; this.expirationDate = expirationDate; this.username = username; } } @observer export default class WebAPIPage extends React.Component<{}, {}> { private get appStore() { return getBrowserWindow().globalStores.appStore; } async downloadDataAccessTokenFile() { const tokenUrl = buildCBioPortalAPIUrl('api/data-access-token'); window.open(tokenUrl, '_blank'); } renderDataAccessTokensDiv() { if ( getServerConfig().authenticationMethod === 'social_auth' || (getServerConfig().dat_method !== 'uuid' && getServerConfig().dat_method !== 'jwt' && getServerConfig().dat_method !== 'oauth2') ) { return
; } else { return (

To directly access the cBioPortal web services on installations which require login, clients will need to obtain a data access token and present this token with each web service request.

There are instructions for making requests to the Web API using Data Access Tokens  here

); } } public render() { return ( {'cBioPortal for Cancer Genomics::Helmet'}

Web API

API documentation is now at{' '} docs.cbioportal.org

{this.renderDataAccessTokensDiv()}

Linking to Us

Once you have a cancer_study_id, it is very easy to create stable links from your web site to the cBio Portal. Stable links must point to ln, and can include the following parameters:

For example, here is a link to the TCGA GBM data for EGFR and NF1:

ln?cancer_study_id=gbm_tcga&q=EGFR+NF1

And a link to TP53 mutations across a curated set of non-redundant studies:

ln?q=TP53:MUT

); } }