Skip to main content
POST
/
v1
/
mgm-stations
/
get-data-logs
Find Paged Data Logs
curl --request POST \
  --url https://risk-api.tarla.io/v1/mgm-stations/get-data-logs \
  --header 'Content-Type: application/json' \
  --data '
{
  "metrics": [
    "PRECIPITATION_SUM"
  ],
  "startDate": "2023-12-25",
  "endDate": "2023-12-25",
  "pageNumber": 1,
  "pageSize": 1000,
  "stationIds": [
    123
  ]
}
'
{
  "totalRecords": 123,
  "totalPages": 123,
  "currentPage": 123,
  "pageSize": 123,
  "stations": [
    {
      "stationId": 123,
      "stationName": "<string>",
      "latitude": 123,
      "longitude": 123,
      "city": "<string>",
      "district": "<string>"
    }
  ],
  "dataLogs": [
    {
      "day": "2023-12-25",
      "stationId": 123,
      "lastUpdated": "2023-11-07T05:31:56Z",
      "stationData": [
        {
          "metric": "PRECIPITATION_SUM",
          "observation": "2023-11-07T05:31:56Z",
          "value": 123
        }
      ]
    }
  ]
}

Body

application/json
metrics
enum<string>[]
required

The type of metric to be requested from stations

Minimum array length: 1
Available options:
PRECIPITATION_SUM,
TEMPERATURE_GROUND_SURFACE_MIN,
TEMPERATURE_MIN,
TEMPERATURE_MAX
startDate
string<date>
required

The start date of the query (this date and after)

endDate
string<date>
required

The end date of the query (this date and before)

pageNumber
integer<int32>

Page number being requested (first page starts with zero)

Required range: x >= 0
pageSize
integer<int32>

Size of the records in response page

Required range: 0 <= x <= 2000
stationIds
integer<int32>[]

The array of IDs of stations to be queried (if not sent with the request, all stations are included in the query)

Response

Success

Paged response structure for data logs

totalRecords
integer<int64>

Total number of available records

totalPages
integer<int32>

Total number of pages

currentPage
integer<int32>

Current page index in pagination

pageSize
integer<int32>

Number of records per page

stations
object[]

List of stations included in this response

dataLogs
object[]

List of data logs in this page