GET /reports/inspections
Inspections are returned sorted descending by their settled
timestamp.
Request parameters
cursor
: Marks the exlusive starting point of the query, only inspections after the cursor position will be returned. It is a composite string of the created and settled timestamps of the last item in a list. Ifcreated
is 123 andsettled
is 234, the cursor will be"123:234"
.from
: Timestamp representing the minimum age of the inspections queried. To fetch all inspections that have been created before today,from
can be set to the timestamp of 00:00 of today. The server is set to UTC.to
: Timestamp representing the maximum age of the inspections queried. To fetch all new inspections that have been created since yesterday,to
can be set to the timestamp of 00:00 of today. The server is set to UTC.
Status codes
200
on success
Response properties
The response format is JSON with the following properties:
list
: Created timestamp, also functions as the id.cursor
: Composite string of the created and settled timestamps of the last item in the list. Ifcreated
is 123 andsettled
is 234, the cursor will be"123:234"
. (optional)
The list is ordered by the settled
timestamp in a decreasing order, so the newest inspection will be first.
If the response returns with a cursor it means there are more inspections available. To fetch all inspections the request has to be repeated with the last cursor until there is no cursor in the response.
Example response:
{
"list": [
{
"created": 1698398075294,
"settled": 1698398075294,
"type": "INSPECTION",
"status": "RESOLVED",
"area": "l01",
"location": "div_HlkuLAdFcM",
"counted_items": 6
},
{
"created": 1677598436854,
"settled": 1677598437886,
"type": "INSPECTION",
"status": "RESOLVED",
"area": "l03",
"location": "div_HlkuLAdFcM",
"counted_items": 1
}
],
"cursor": "1677598436854:1677598437886"
}
To see the details of an inspection, use GET /reports/inspections/:id
with the created timestamp as the id
.