Class: Api::V2::ReceptacleResource

Inherits:
BaseResource
  • Object
show all
Includes:
SharedBehaviour::Receptacle
Defined in:
app/resources/api/v2/receptacle_resource.rb

Overview

Note:

Access this resource via the /api/v2/receptacles/ endpoint.

Note:

The below POST errors due to display_name missing. However, when display_name

Provides a JSON:API representation of Receptacle.

A receptacle is a container for aliquots, they are associated with Labware, which represents the physical object which moves round the lab. A Labware may have a single Receptacle, such as in the case of a Tube or multiple, in the case of a Plate. Work can be requested on a particular receptacle.

This resource includes common behavior shared across various receptacles. This behavior is imported from the Api::V2::SharedBehaviour::Receptacle module.

is included, the response says “display_name is not allowed”.

For more details on JSON:API, see the JSON:API Specifications or check out the JSONAPI::Resources package for Sequencescape's implementation.

Examples:

GET request to retrieve all receptacles

GET /api/v2/receptacles/

GET request to retrieve receptacles with a specific UUID

GET /api/v2/receptacles?filter[uuid]=abc123

GET request to retrieve samples associated with a specific receptacle

GET /api/v2/receptacles/1/samples

POST request to create a new receptacle

POST /api/v2/receptacles/
{
  "data": {
    "type": "receptacles",
    "attributes": {
      "name": "Tube Rack 1",
      "pcr_cycles": 25,
      "submit_for_sequencing": true
      // "display_name": "2"
    },
    "relationships": {
      "labware": {
        "data": {
          "type": "labware",
          "id": 1
        }
      }
    }
  }
}

PATCH request to update an existing receptacle

PATCH /api/v2/receptacles/1
{
  "data": {
    "id": 1,
    "type": "receptacles",
    "attributes": {
      "pcr_cycles": 26,
    },
  }
}

Method Summary

Methods inherited from BaseResource

apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields