GET V1 ems/attachments?entityType={entityType}&entityId={entityId}

Retrieves a collection of attachments linked to an EMS entity.

Authentication

This endpoint requires the api-username and api-usertoken headers for authentication.

Request Information

Parameters

NameDescriptionAdditional information
entityType
The entity type. This should be one of the following: experiment, plate, well,
            study, project

Define this parameter in the request URI.

entityId
The entity ID. This should be an ID that exists for the specified entity type.

Define this parameter in the request URI.

Example Request

To get the details for the attachments linked to the experiment with ID 1234, make the following API call:

GET /ems/attachments?entityType=experiment&entityId=1234

Response Information

HTTP Status Codes

Status CodeMeaning
200 (OK) The request completed successfully. The results will be contained in the response body.
400 (Bad Request) The entity type was invalid. Ensure you are using one of the entity types allowed for this call.
401 (Unauthorized) The user has not been authorised.
Please ensure that the client provides the api-username and api-usertoken headers.
404 (Not Found) No entity with the given ID was found.

Response Detail

The response may be an empty collection, which indicates a successful request to an entity with no attachments.

Response Body Formats

application/json, text/json

Sample:
[
  {
    "Id": "a321ef423922495e8cb66920522db2a4",
    "Filename": "helloworld.txt",
    "Description": "Example attachment for this entity",
    "Created": "2015-11-22T00:00:00",
    "Kind": "Generic"
  },
  {
    "Id": "c01d823332394bf8892921978063d27c",
    "Filename": "test-run-2015-11-21.xslm",
    "Description": "Setup script for experiment",
    "Created": "2015-11-21T00:00:00",
    "Kind": "Lisa-Marie Setup File"
  }
]

application/xml, text/xml

Sample:
<ArrayOfAttachment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Unilever.Urdps.Hts.EmsApi.EntityRepresentations.EMS.V1">
  <Attachment>
    <Created>2015-11-22T00:00:00</Created>
    <Description>Example attachment for this entity</Description>
    <Filename>helloworld.txt</Filename>
    <Id>a321ef423922495e8cb66920522db2a4</Id>
    <Kind>Generic</Kind>
  </Attachment>
  <Attachment>
    <Created>2015-11-21T00:00:00</Created>
    <Description>Setup script for experiment</Description>
    <Filename>test-run-2015-11-21.xslm</Filename>
    <Id>c01d823332394bf8892921978063d27c</Id>
    <Kind>Lisa-Marie Setup File</Kind>
  </Attachment>
</ArrayOfAttachment>