Last updated

Getting started

This page provides the simplest path for quickly using the API to get a protocol running.

Establish connection

Perform this GET request to determine if the API is available and ready to accept other requests.

Go to Check if the system is ready for more information.

get/api/v2/system-ready
curl 'http://{{your_prep_ip_address}}/api/v2/system-ready' \
  --header 'Authorization: Bearer <token>'
Response
The system ready object

Verify that user management is enabled

Before continuing, verify that user management is enabled to determine whether authentication is necessary.

If user management is disabled, authentication can be skipped.

Go to Enable or disable user management for more information.

get/api/v2/settings/enable-user-management
curl 'http://{{your_prep_ip_address}}/api/v2/settings/enable-user-management' \
  --header 'Authorization: Bearer <token>'
Response
The status of the user management

Authenticate

Authenticate a user for privileged, actionable operations (e.g., running protocols). Go to the Authentication recipe for more information about authenticating.

If user management is disabled, skip this step.

Go to Authenticate the user for more information.

post/api/v2/authenticate
curl 'http://{{your_prep_ip_address}}/api/v2/authenticate' \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --data '{
  "username": "string",
  "password": "string"
}'
Response
The login was successful

Retrieve protocol list

Before running a protocol, review the protocols in the system to obtain the protocol ID of the desired protocol to run.

Go to Retrieve the list of protocols for more information.

get/api/v2/protocols
curl 'http://{{your_prep_ip_address}}/api/v2/protocols' \
  --header 'Authorization: Bearer <token>'
Response
The list of protocols

Create a protocol run

Creating a protocol run prepares the system for protocol execution and loads the deck. Use a protocol ID found in the protocol list to send this request.

post/api/v2/protocol-run/create
curl 'http://{{your_prep_ip_address}}/api/v2/protocol-run/create' \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --data '{
  "protocolId": 0,
  "simulate": true,
  "recompile": true
}'
Response
The run was created successfully

Poll run state

Before loading the deck, verify that the Prep software has finished preparing the protocol run. Wait until protocolRunState changes to 20, meaning it is in the loading state.

A more advanced and efficient approach for this would be listening for events to determine when the correct state is reached.

Go to Get the current run status for more information.

get/api/v2/protocol-run
curl 'http://{{your_prep_ip_address}}/api/v2/protocol-run' \
  --header 'Authorization: Bearer <token>'
Response
The current run status

Get load instructions

Retrieve the load instructions to verify the labware the protocol is expecting.

Go to Retrieve the load instructions for more information.

get/api/v2/protocol-run
curl 'http://{{your_prep_ip_address}}/api/v2/protocol-run' \
  --header 'Authorization: Bearer <token>'
Response
The current run status

Complete protocol loading

After labware is properly loaded onto the deck, complete protocol loading to start executing the run.

Go to Complete the loading for the run for more information.

put/api/v2/protocol-run/load-complete
curl 'http://{{your_prep_ip_address}}/api/v2/protocol-run/load-complete' \
  --request PUT \
  --header 'Authorization: Bearer <token>' \
  --data '{
  "protocolId": 0,
  "simulate": true,
  "loadCompleteAction": "Run",
  "residualTips": [
    {
      "deckPosition": 0,
      "residualTipData": {
        "useAllAddresses": null,
        "addresses": null
      }
    }
  ],
  "barcodes": [
    {
      "deckPosition": 0,
      "address": {
        "row": null,
        "column": null
      },
      "barcodeValue": "string"
    }
  ],
  "liquidVolumes": [
    {
      "deckPosition": 0,
      "positionOnSite": 0,
      "row": 0,
      "column": 0,
      "volume": 0
    }
  ]
}'
Response
Loading completed successfully

Poll protocol status until completion

After all steps have been followed, wait for protocol execution to complete. Poll for the protocolRunState to be 0 (idle), or until isRunInProgress is false.

A more advanced and efficient approach for this would be listening for events to determine when the correct state is reached.

Go to Get the current run status for more information.

get/api/v2/protocol-run
curl 'http://{{your_prep_ip_address}}/api/v2/protocol-run' \
  --header 'Authorization: Bearer <token>'
Response
The current run status