NIH | National Cancer Institute | NCI Wiki  

You can try the caDSR APIs to search for caDSR data by entering a URL in the address bar of a browser and passing parameters in that URL. This page provides examples to get you started. 

A URL in caDSR II format returns HTML, XML, or JSON. Using the API, you can allow an application to connect to caDSR and search the database. The caDSR II Domain Class Browser page is a web browser interface that allows you to test the caDSR II API.

You can display any of these formats (HTML, XML, or JSON) in an Internet browser by changing the parameter (GetHTML, GetXML, or GetJSON). 

Multiple AND IN Note

You cannot enter multiple "and" or "in" values for search criteria when using the REST (XML-HTTP) API.

If you have trouble using any URL on this page in your Internet browser, copy and paste it into a Google Chrome browser before contacting Application Support (NCIAppSupport@mail.nih.gov).

This page includes the following topics.

Contents of This Page

Find a Form Using Form Public ID and Version, Display Basic Metadata Attributes

The following example finds a Form where Public ID = 2392775 and Version=1.0, displaying the basic metadata attributes. 

The URL for the results from the caDSR II REST API is

https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=Form[@publicId=2392775,@version=1]

Find a Form Using Only Public ID

The following example finds a Form with Public ID = 2392775, displaying the basic metadata attributes. Since the version is not known, this query can only be handled via a caDSR REST API query.

The URL for the results from the caDSR II REST API is

https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=Form[@publicId=2392775]

Find a Form Using Public ID, Display All Metadata Associated with Data Elements

The following example finds a Form with Public ID = 2392775, displaying all the metadata associated with the data element's related components, not just the basic attributes. This is handled in the caDSR REST API using a parameter that produces expanded ("heavy") XML.

The URL for the results from the caDSR II REST API is

https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=Form[@publicId=2392775]&returnHeavyXML=true

Find All Forms Associated with Particular Data Element Public ID and Version

The following example finds all the Forms associated with the CDE with Public ID = 2183364, Version 1.0, displaying the basic metadata of the Form.

The URL for the results from the caDSR II REST API is

https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=Form,Module,Question&DataElement[@publicId=2183364,@version=1.0]

Get all Modules Associated with a Form Using Form Public ID

The following example gets all the modules for a form with Public ID = 2392775.

The URL for the results from the caDSR II REST API is

https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=Module&Form[@publicId=2392775,@version=1.0]

Get All the Questions for a Module Using Module Public ID and Version

The following example gets all the questions for a module with Public ID = 2392777 and version = 1.0.

The URL for the results from the caDSR II REST API is

https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=Question&Module[@publicId=2392777,@version=1.0]

Get All the Data Elements for Question Using Question Public ID and Version

The following example gets all the data elements for a question with Public ID = 2392779 and version = 1.0.

The URL for the results from the caDSR II REST API is

https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=DataElement&Question[@publicId=2392779,@version=1.0]

Retrieve a caDSR Form with All Its Collections ("Flattened")

The following caDSR II examples retrieve a caDSR form with all its collections, or "flattened". This means for a given form, the system returns all Modules, Questions, Valid Values and related instructions in one call. The system returns results as a JSON file. XML and HTML formats are not available for this query. You must specify a version. 

The following example retrieves a form without specifying a protocol:

https://cadsrapi.cancer.gov/invoke/form.test/getJSON?query=Form[@publicId=7203785,@version=1]

The following example specifies a protocol: 

https://cadsrapi.cancer.gov/invoke/form.test/getJSON?query=Form[Protocol[@preferredName=C3D%20ADOPTER%20TEMPLATES],@publicId=2392775,@version=1]

Return Form by Public ID and Protocol

The following caDSR II example retrieves forms with protocol by public ID.

https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=Form[Protocol[@preferredName=C3D ADOPTER TEMPLATES],@publicId=2392775]



  • No labels