# Retrieve Security Environments

This API is responsible for retrieving all Security environments that are connected to a unique **itemId** and **taxId**.

<p class="callout info">**\[GET\]/api/v1/{itemId}/intermediary/{taxId}/security-environment**</p>

**Response:** List of Security Environments with an active status.

### Header

Header used on this API are those taken from [header standards of TS Digital.](https://digital-docs.ts-paas.com/books/utilizzo-api-tsdigital/page/linee-guida-generali-api-ts-digital)

`Content-type` is accepted in `application/json`

### Query Parameters

Parameters used to make a successful request.

- **itemId**: Unique personal identification of the item associated with Security Environments requested. Mandatory for personal or technical users .(<span style="background-color: #ffffff; color: #ff0000;">***required***</span>)
- **taxId**: Unique fiscal code of the item associated with Security Environments requested. (<span style="color: #ff0000;">***required***</span>)

### Body

No body is needed to make this request.

### Response

##### On successful response

If successful, the **API** responds with HTTP code **200(OK)** with the following body:

```JSON
[
    {
    "id": "string",
    "siteCode": "string",
    "entratelCode": "string",
    "description": "string",
    "startDate": "2022-05-06T08:48:50.675Z",
    "expirationDate": "2022-05-06T08:48:50.675Z",
    "createdAt": "2022-05-06T08:48:50.675Z",
    "createdBy": "string",
    "updatedAt": "2022-05-06T08:48:50.675Z",
    "updatedBy": "string"
    }
 ]
```

- **id:** Unique identifier.
- **siteCode:**
- **entratelCode:**
- **startDate:** Start date of the Security Environment.
- **expirationDate:** Expiration date of Security Environment.
- **createdAt:** Date of Security Environment creation.
- **createdBy:** Item which created requested Security Environment.
- **updatedAt:** Date of the last update for the requested Security Environment.
- **updatedBy:** Item which updated requested Security Environment.

##### On error response

In the event of an error, the **API** responds with a body **JSON** with the following format:

```JSON
{
  "code": "string",
  "timestamp": "2022-05-05T12:46:42.016Z",
  "message": "string",
  "subErrors": [
    {}
  ]
}
```

- **code**: A string representation of the HTTP error code, linked with the returned http error
- **timestamp**: Date and time of the answer, expressed as a string.
- **message**: Message expressing error.

Possible errors are:

- **400**: The request is malformed (parameters with incorrect format, invalid or inconsistent parameters).
- **401**: An authorization token has not been provided or the authorization token provided is invalid (eg: it has expired).
- **403**: The provided token is valid, but the user is not authorized to perform the operation.
- **500**: An unexpected error occurred.