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 '{
  "pageNumber": 1,
  "pageSize": 1000,
  "stationIds": [
    123
  ],
  "metrics": [
    "PRECIPITATION_SUM"
  ],
  "startDate": "2023-12-25",
  "endDate": "2023-12-25"
}'
{
  "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 length: 1
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

Page number being requested (first page starts with zero)

Required range: x >= 0
pageSize
integer

Size of the records in response page

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

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

Total number of available records

totalPages
integer

Total number of pages

currentPage
integer

Current page index in pagination

pageSize
integer

Number of records per page

stations
object[]

List of stations included in this response

dataLogs
object[]

List of data logs in this page