---
title: Retrieve last session date
method: GET
weight: 4
section: 'Basics'
---

import {
  EndpointHeader,
  ParamField,
  ParamFields,
  RequestExample,
  ResponseExample,
  CodeGroup,
} from '@/components/api';

<EndpointHeader method="GET" path="/api/v1/stations/last_seance_event_time" />

Returns the date of the last communication session of a metering unit.

<ParamFields title="Query parameters">
  <ParamField name="id" type="integer" required>
    Metering unit identifier.
  </ParamField>
</ParamFields>

## Response fields

| Attribute                | Description                                                                |
| ------------------------ | -------------------------------------------------------------------------- |
| `station_name`           | Metering unit name                                                         |
| `last_seance_event_time` | Date and time of the last communication session of the metering unit (UTC) |

<RequestExample>
  <CodeGroup labels={["curl", "Node", "Python", "Go", "PHP"]}>
    <Fragment slot="panel-0">

```bash
curl -i \
  --header "access-token: *********************" \
  --header "token-type: Bearer" \
  --header "client: **********************" \
  --header "uid: user@local.net" \
  --header "Content-Type: application/json" \
  --request GET \
  "https://uztgs.uz/api/v1/stations/last_seance_event_time?id=2018"
```

    </Fragment>
    <Fragment slot="panel-1">

```js
const res = await fetch('https://uztgs.uz/api/v1/stations/last_seance_event_time?id=2018', {
  headers: {
    'access-token': '*********************',
    'token-type': 'Bearer',
    client: '**********************',
    uid: 'user@local.net',
    'Content-Type': 'application/json',
  },
});
const data = await res.json();
```

    </Fragment>
    <Fragment slot="panel-2">

```python
import requests

res = requests.get(
    "https://uztgs.uz/api/v1/stations/last_seance_event_time",
    params={"id": 2018},
    headers={
        "access-token": "*********************",
        "token-type": "Bearer",
        "client": "**********************",
        "uid": "user@local.net",
        "Content-Type": "application/json",
    },
)
data = res.json()
```

    </Fragment>
    <Fragment slot="panel-3">

```go
req, _ := http.NewRequest("GET", "https://uztgs.uz/api/v1/stations/last_seance_event_time?id=2018", nil)
req.Header.Set("access-token", "*********************")
req.Header.Set("token-type", "Bearer")
req.Header.Set("client", "**********************")
req.Header.Set("uid", "user@local.net")
req.Header.Set("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)
```

    </Fragment>
    <Fragment slot="panel-4">

```php
$ch = curl_init("https://uztgs.uz/api/v1/stations/last_seance_event_time?id=2018");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "access-token: *********************",
    "token-type: Bearer",
    "client: **********************",
    "uid: user@local.net",
    "Content-Type: application/json",
]);
$data = json_decode(curl_exec($ch), true);
```

    </Fragment>

  </CodeGroup>
</RequestExample>

<ResponseExample>

```json
{
  "data": {
    "station_name": "station 3 type j",
    "last_seance_event_time": 1674713405
  }
}
```

</ResponseExample>
