Unit of the element quantity. The endpoints are served from /new_api/projects/{projectId}/maps/{mapId}/bio_entities/elements/{id}/unit.

1. Get unit

Returns the unit assigned to the element.

1.1. HTTP request

GET /minerva/new_api/projects/test_project/maps/244/bio_entities/elements/662/unit HTTP/1.1

1.2. Path Parameters

Table 1. /minerva/new_api/projects/{projectId}/maps/{mapId}/bio_entities/elements/{id}/unit
Parameter Description

projectId

project identifier

mapId

map identifier

id

unique element identifier (the numeric "id" field of the element, not the "elementId" taken from the source file)

1.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/244/bio_entities/elements/662/unit' -X GET \
    -H 'Authorization: Bearer xxxxxxxx'

1.4. HTTP response

HTTP/1.1 200 OK

1.5. Sample Response

{
  "id" : 216,
  "unitId" : "u1",
  "name" : "Weight",
  "unitTypeFactors" : [ ]
}

2. Set unit

Assigns a unit (defined in the map) to the element.

Note
Supports optimistic locking via the If-Match header.

2.1. HTTP request

POST /minerva/new_api/projects/test_project/maps/242/bio_entities/elements/655/unit HTTP/1.1

2.2. Path Parameters

Table 2. /minerva/new_api/projects/{projectId}/maps/{mapId}/bio_entities/elements/{id}/unit
Parameter Description

projectId

project identifier

mapId

map identifier

id

unique element identifier (the numeric "id" field of the element, not the "elementId" taken from the source file)

2.3. Request Fields

Path Type Description

id

Number

identifier of the referenced entity

2.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/242/bio_entities/elements/655/unit' -X POST \
    -H 'Authorization: Bearer xxxxxxxx' \
    -d '{"id":214}' \
    -H 'Content-Type: application/json'

2.5. HTTP response

HTTP/1.1 200 OK

2.6. Sample Response

{
  "id" : 214,
  "unitId" : "unused",
  "name" : null,
  "unitTypeFactors" : [ ]
}