Creating Samples and Projects via the API

Assumptions

The incoming message contains the following:

  • Project ID or Name

  • Sample ID or Name

  • Container ID or Name

  • Container type (plate / tube type)

  • Container well position (if sample is on a plate) eg G:2

  • Sample user-defined fields (UDFs) / custom fields

Main Logic

Does the project exist?
    if NO: create it
Does the container exist?
    if NO: create it
Create sample

Create a Sample:

POST to https://your_server/api/v2/samples:

We receive something like the following:

Create a Project:

POST to https://your_server/api/v2/projects

We receive something like the following:

Create a Container (tube):

POST to https://your_server/api/v2/containers:

We receive something like the following:

Create a Container (96 well plate):

POST to https://your_server/api/v2/containers:

We receive something like the following:

Create a Sample in the 96 Well Plate Rreated, and the Project Created:

POST to https://your_server/api/v2/samples:

We receive something like the following:

Confirm the Project Exists

GET: https://your_server/api/v2/projects?name=Week%2039

If the project exists, we receive something like the following:

If the project does not exist, we receive something like the following:

Confirm the Container Exists

GET: https://your_server/api/v2/containers?name=Example%20Container%2020140910

If the container exists, we receive something like the following:

If the container does not exist, we receive something like the following:

Last updated

Was this helpful?