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

Retrieves a collection of attachments linked to an EMS entity.

Request Information

Parameters

Name Description Additional 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 Code Meaning
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 due to the below reasons which will be displayed in the response content.
API Key is not found. Data received apiKey
Secret Key is wrong. Data received apiKey
Username not found. Data received apiKey
Received token not found in EMS issuer. Data received username, version
Lifetime validation failed. The token is expired. ValidTo (UTC): expiry, Current time (UTC): UTC DateTime
Token creation failed. Reason: The given username or password is wrong. For input: username, version
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>