This endpoint requires the user to be a vault admin.
API calls related to batch move job objects:
Retrieve
GET /api/v1/vaults/<vault_id>/batch_move_jobs/<id>
Get a single batch move job.
GET /api/v1/vaults/<vault_id>/batch_move_jobs
Get all batch move jobs.
Example
curl -H "X-CDD-Token: $TOKEN" -X GET "https://app.collaborativedrug.com/api/v1/vaults/<vault_id>/batch_move_jobs/<batch_move_job_id>"
Returns:
{
"id": <batch_move_job_id>,
"class": "batch move job",
"created_at": "2023-06-29T21:06:15.818Z",
"modified_at": "2023-06-29T21:06:15.818Z",
"status": "requested",
"fail_on_molecule_deletion": true,
"molecule": 1,
"batch": 618771089,
"requested_by": 480475048
}
Note: The status values returned with the GET batch_move_jobs API call will be one of these:
- requested
- queued
- processing
- success
- failure
- canceled
Create
POST /api/v1/vaults/<vault_id>/batch_move_jobs
Create a new batch move job to move a batch to a different molecule in the same vault.
Parameters
batch |
The batch to move. Required. |
molecule |
The molecule to move the batch to. Required. |
name |
A new name for the batch. Optional. Only allowed for vaults without a registration system. |
fail_on_molecule_deletion |
Fail if moving the batch would trigger the removal of the originating molecule. Default true. |
Example
curl -H "X-CDD-Token: $TOKEN" -X POST "https://app.collaborativedrug.com/api/v1/vaults/<vault_id>/batch_move_jobs?batch=<batch_id>&molecule=<molecule_id>&name=<new batch name>"
Returns:
{
"id": 1,
"class": "batch move job",
"created_at": "2023-06-29T21:06:15.818Z",
"modified_at": "2023-06-29T21:06:15.818Z",
"name": <new batch name>,
"status": "requested",
"fail_on_molecule_deletion": true,
"molecule": <molecule_id>,
"batch": <batch_id>,
"requested_by":<your user_id>
}
Delete
DELETE /api/v1/vaults/<vault_id>/batch_move_jobs/<id>
Cancel a single batch move job. Once a job starts it cannot be canceled.
Example
curl -H "X-CDD-Token: $TOKEN" -X DELETE "https://app.collaborativedrug.com/api/v1/vaults/<vault_id>/batch_move_jobs/<batch_move_job_id>"
Returns:
{
"id": <batch_move_job_id>,
"class": "batch move job",
"created_at": "2023-06-29T21:06:15.818Z",
"modified_at": "2023-06-29T21:06:15.818Z",
"status": "canceled",
"fail_on_molecule_deletion": true,
"molecule": 1,
"batch": 618771089,
"requested_by": 480475048
}