Read list of Inspections

GET /reports/inspections

Inspections are returned sorted descending by their settled timestamp.

Request parameters

  • division: Filter inspections by division ID.
  • area: Filter inspections by area ID.
  • 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.
  • cursor: Marks the exclusive starting point of the query, only inspections after the cursor position will be returned. It is the created timestamp of the last item in a list.

Status codes

  • 200 on success

Response properties

The response format is JSON with the following properties:

  • entries: The list of inspection entries with the following properties:
    • created: Created timestamp, also functions as the id.
    • location_id: The id of the site or location where the area is located. (optional)
    • area_id: Area ID of the inspection.
    • state: The state of the inspection (see below for details).
    • name: The customer provided name of the inspection.
    • inspection_counts: The number of inspection lists in the report.
    • counted_items: The number of items in the report.
  • cursor: Created timestamp of the last item in the list. (optional)

The entries are ordered by the created 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.

Inspection state

The state object of an inspection entry always has a status property. The status can be one of the following:

  • COMPLETED: The inspection is completed. No additional properties.
  • PROCESSED: The inspection was processed with pending differences. The differences property will be present and reflect the number of pending differences.
  • PROCESSING: The inspection is being processed. If an error occurs during processing, the error property will be present with the timestamp when the error occurred.

Example response:

{
  "entries": [
    {
      "created": 1698398075294,
      "location_id": "div_HlkuLAdFcM",
      "area_id": "are_57osC3HVZL",
      "state": {
        "status": "COMPLETED"
      },
      "name": "February inspection",
      "inspection_counts": 2,
      "counted_items": 42
    },
    {
      "created": 1677598436854,
      "location_id": "div_HlkuLAdFcM",
      "area_id": "are_57osC3HVZL",
      "state": {
        "status": "COMPLETED"
      },
      "name": "January inspection",
      "inspection_counts": 1,
      "counted_items": 27
    }
  ],
  "cursor": 1677598436854
}

To get the download URL of an inspection, use GET /reports/inspections/:id with the created timestamp as the id.