Information submitted through the support site is private but is not hosted within your secure CDD Vault. Please do not include sensitive intellectual property in your support requests.

Bulk Export

Bulk export is a sequence of operations that allows you to programmatically export data from a CDD vault. Bulk export works via saved searches, which means you must first specify your search using the CDD’s web interface, save that search, and then use the ID number of that saved search in the API.

Bulk Export is a three step process. The first step specifies the search to use, the format of the output, and where to search. This step creates a new export object within CDD. The second step is a call to determine if the data is ready for export, and the third step is the call  to actually download the data .

 

Step 1: Initiate an Export Request

POST /api/v1/vaults/$VAULT_ID/exports

 

This call will initiate the export. The search is applied to the specified projects and public data sets. Both the projects and data_sets parameters are optional; the default behavior is to search over all the available projects and none of the public data sets.

Parameters:

search (required) The numeric id of a saved search
format The file format to generate; one of “csv”, “sdf”, or “xls”.

The default is “csv”.
projects The projects to search for data to be exported. The format is a list of numeric project ids separated by commas.

The default is to search all projects that the user has access to in the specified vault.

Use “projects=” to indicate that no projects should be searched (e.g. searching a public data set only)
data_sets The public data sets to search for data to be exported. The format is a list of numeric data set ids separated by commas.

The default is to not search any public data sets.

 

Response:

A JSON object with the following fields:

status The status of the export. Should be “new”.
id The ID of the export task. You will need to supply this ID for the subsequent steps.

Example:

curl -X POST -H X-CDD-Token:$TOKEN 'https://app.collaborativedrug.com/api/v1/vaults/23/exports.csv?search=264&projects=34888,45466'

 

Result:

{"id":18765,"status":"new"}

 

Step 2: Check Export Status

Check on the status of your export task. Repeat this call until the status is “finished”

GET /api/v1/vaults/$VAULT_ID/export_progress/$EXPORT_ID

Response:

Format is same as in step 1, but status should be either “new”, “started”, or “finished”. If it is any other value, something has gone wrong with your export.

Example:

curl 'https://app.collaborativedrug.com/api/v1/vaults/23/export_progress/18765'

Result:

{"id":18765',"status":"finished"}

 

Step 3: Download Data

Once the file is ready (when its status in step 2 is “finished”), you can download the data through this URL:

GET /api/v1/vaults/$VAULT_ID/exports/$EXPORT_ID

Response:

File contents in whatever format was requested. If the export is not ready, the server will return HTTP status code 403 (Forbidden).

Example:

 

curl 'https://app.collaborativedrug.com/api/v1/vaults/23/exports/18765'


Result:

Molecule Name,CDD Number,Arginine kinase inhibition: RFU (rfu)

Benzene,CDD-1,0.17

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.