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.

Run(s) [GET, PUT, DELETE]

API calls related to runs:

Retrieve

Update

Destroy

Retrieve

GET /api/v1/vaults/<vault_id>/runs/<id>

Retrieve a single run.

Examples

Retrieve a single run

curl -H "X-CDD-Token: $TOKEN" https://app.collaborativedrug.com/api/v1/vaults/489978881/runs/753311875

Returns:

{
  "id": 753311875,
  "class": "run",
  "created_at": "2007-12-18T16:22:36.000Z",
  "modified_at": "2007-12-18T16:22:36.000Z",
  "run_date": "1988-11-04"
}

Update

PUT /api/v1/vaults/<vault_id>/runs/id

Updates an existing Run.

This PUT Runs API call allows users to update the Run’s Project association and the Run_Date, Person, Place, and Conditions fields.

Examples

curl -H "X-CDD-Token: $TOKEN" -X PUT -H "Content-Type: application/json" -d "@data.json" https://app.collaborativedrug.com/api/v1/vaults/489978881/runs/1055309345

File data.json:

{
    "project":"New Project",
    "run_date":"2020-09-14",
    "conditions":"New Condition",
    "place":"New Lab",
    "person":"New Person"
}

Returns:

{
    "id": 1055309345,
    "class": "run",
    "created_at": "2013-03-19T18:35:02.000Z",
    "modified_at": "2020-09-14T14:26:58.000Z",
    "run_date": "2020-09-14",
    "person": "New Person",
    "place": "New Lab",
    "conditions": "New Condition",
    "source_files": [
        {
            "id": 66399,
            "name": "DataToImport.csv"
        }
    ],
    "attached_files": [],
    "project": {
        "name": "New Project",
        "id": 9812
    }
}

Destroy

DELETE /api/v1/vaults/<vault_id>/runs/<id>

Delete a single run.

 

DELETE /api/v1/vaults/<vault_id>/runs?slurp=<slurp_id>

Delete runs associated with a single slurp.

Parameter:

slurp Specify the slurp_id of an import operation.
All runs associated with the slurp will be deleted if the user has permissions for all runs. If not, no runs will be deleted.

 

Examples

Delete a single run

curl -H "X-CDD-Token: $TOKEN" -X DELETE https://app.collaborativedrug.com/api/v1/vaults/489978881/runs/753311875

Returns:

{
  "message": "Run with ID 753311875 has been destroyed"
}

 

Delete runs associated with a slurp

curl -H "X-CDD-Token: $TOKEN" -X DELETE https://app.collaborativedrug.com/api/v1/vaults/489978881/runs?slurp=75212865

{
  "status": 204,
  "message": "Runs destroyed"
}