Request
GET /wait
Waits until a new report is available or timeout expires.
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
lastSerial |
Integer | Query | Yes | Latest serial known by client (must be >= 0) |
timeout |
Integer | Query | No | Wait timeout in seconds (1–75, default = 75) |
delete |
Boolean | Query | No | If true, delete the report after returning it
(default = false). |
Responses
200 (OK): New reports with serials
> lastSerial.
{
"reports": [
{
"serial": 7,
"timestamp": "2025-10-01T12:35:20Z",
"content": "S=AWS830_DEMO,D=2025-10-01,T=12:35:20,TA=15.6,RH=86,PA=1013.0"
},
{
"serial": 8,
"timestamp": "2025-10-01T12:35:30Z",
"content": "S=AWS830_DEMO,D=2025-10-01,T=12:35:30,TA=15.7,RH=85,PA=1012.9"
}
]
}
204 (No content): Timeout expired with no new reports.
(empty response body)
400 (Bad request): Invalid parameters.
{
"message": "lastSerial (100) is greater than current max serial (50)"
}
Behavior
- Returns immediately if reports with
serial > lastSerialalready exist. - Blocks up to
timeoutseconds if there are no new reports yet. - Returns
204 (No content)if timeout expires with no new reports.
Example cURL
# Initial fetch (lastSerial=0 gets all pending reports)
curl -X GET \
"https://station.example.com/api/application/https_server_1/reports/v1/wait?lastSerial=0&timeout=30&delete=true" \
-H "X-Api-Key: <base64-encoded-api-key>"
# Subsequent fetch using highest serial from previous response
curl -X GET \
"https://station.example.com/api/application/https_server_1/reports/v1/wait?lastSerial=8&timeout=30&delete=true" \
-H "X-Api-Key: <base64-encoded-api-key>"