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.

GET POST PUT Batch(es)

API calls related to batch objects:

Retrieve

Create 

Update

 

Retrieve


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

Get a single batch.


GET /api/v1/vaults/<vault_id>/batches

Get a collection of batches.


Parameters (all optional):

>

created_before date
created_after date
modified_before date
modified_after date
molecule_created_before date
molecule_created_after date


Returns:

Batch JSON

 

Create

 

POST /api/v1/vaults/<vault_id>/batches/

Creates a new batch.

 

The body of the POST must contain a JSON structure specifying the molecule attributes. The structure is roughly the same format as what is returned by a GET call but with some restrictions and additions.

 

The HTTP response contains the full JSON representation of the new batch (as would be returned from a GET).

 

Allowed JSON keys for batches:

class

Optional. If present, must be “batch”

molecule

A dictionary specifying the molecule

(see below)

name, projects, batch_fields

As in GET

salt_name

A two-letter code or Salt vendor string as listed in the All Available Salts table (registration vaults only).

stoichiometry

As in GET (registration vaults only)

Whether the POSTing in a registration or non-registration vault, the JSON must indicate the Molecule to which the new batch is being added.

 

The value for the molecule field is a dictionary, which may take several forms:

  • {"id": <number>}

  • {"name": <name>}

  • {"structure": <structure>}

  • {“smiles”: <smiles>}

  • {“cxsmiles”: <cxsmiles>}

  • {“iupac_name”: <iupac name>}

If the POST is for an existing molecule, the molecule should be identified using one (and only one) of the above identifier forms. However, if you include additional information about the existing molecule such as Synonyms, UDFs, Descriptions, it will be appended to the molecule record during the POST.

 

If the POST is for a new molecule, the id field cannot be included; and in a registration vault, the name cannot be included (since only the CDD registration system can create a new Molecule name in a registration vault). When POSTing a new batch for a new molecule, it of course makes sense to provide as many attributes as needed to describe the new molecule. This includes chemical structure (structure/smiles/etc), Projects, Synonyms, UDFs, Descriptions, etc; For non-registration vaults, a name will be required). See Create Moleculefor the exact requirements. For both registration and non-registration vaults, creation of a new Molecule requires association with at least one Project.

 

Note that in a registration vault, POST batch is the only way to create a new molecule, since the registration of a new molecule must be accompanied by a first batch. In this case, the JSON describing the batch will include a "molecule" field with detailed information on the new molecule.

 

In addition to molecule information, information about the new Batch must be provided as well. Each vault has its own settings on the minimum information required to create a new Batch (for a Vault Administrator, see Manage Vault--> Registration Rules, which Batch fields are required).

 

Here is an example of POSTing a new Batch for an existing molecule in a non-registration vault. In this vault, the batch fields Date, Purity and UniqueID are required. And in this example, the molecule is identified by its structure, but name or id would have been accepted as well.

{

"name": "Batch 02",

"projects": [{"name":"Test 1"}],

"batch_fields":

       {

           "Date":"2013-04-15",

           "Purity":"99.44",

           "UniqueID":"Ibuprofen Batch 02"

        },

 "molecule":

   {

      "smiles": "CC(C)Cc1ccc(cc1)C(C)C(=O)O"

   }

}

 

In registration vaults, salts for the new batch can and should be specified (unless a no salt/free base batch is being registered). This example shows POSTing for a batch which has two Phosphoric acid salts (and two waters). When using the batch field "salt_name", the stoichiometry object must be included as well.

{

"molecule":

 {

     "id":23827968

 },

 "projects": [{"name":"TestProject1"}],

 "batch_fields": {

    "Person": "Jane Chemistry",

    "Date": "2013-04-15",

    "Vendor": "Vandelay Industries"

  },

   "salt_name": "Phosphoric acid",

   "stoichiometry": {

       "salt_count": 2,

       "hydrate_count": 2,

       "core_count": 1

   }

}


For labs that prefer to specify salts via structure (e.g. SMILES string), simply include the salt and any waters in the structure representation. In this example, a batch that is a biisodium salt and monohydrate of ibuprofen is registered.

{

"molecule":

 {

     "smiles":"CC(C)CC1=CC=C(C=C1)C(C)C(O)=O.[Na].[Na].O"

 },

 "projects": [{"name":"TestProject1"}],

 "batch_fields": {

    "Person": "Jane Chemistry",

    "Date": "2013-04-15",

    "Vendor": "Vandelay Industries"

  }

}

As always, mixed salts are not accepted.


Update


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

Update an existing batch.

 

The body of the POST must contain a JSON structure specifying changes to batch attributes. The structure is roughly the same format as what is returned by a GET call but with some restrictions and additions. Fields that are not specified in the JSON are not changed. See the documentation for the POST call to see what JSON attributes are allowed.

 

Note that the ID for the batch is specified as part of the URL, not in the JSON (the JSON can contain an ID field as long as its value matches the URL).

 

The HTTP response contains the full JSON representation of the updated batch (the same as would be returned from a GET)

 

Here is an example of changing the salt of a batch in a registration vault. The batch is identified by its ID number in the url.

PUT /api/v1/vaults/<vault_id>/batches/123456

{

  "salt_name": "Phosphoric acid",

   "stoichiometry": {

       "salt_count": 2,

       "hydrate_count": 2,

       "core_count": 1

     }

}

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.