Skip to main content

Get Inspection data

Support avatar
Written by Support
Updated over a month ago

GET [ inspection ]

when provided, both date_from and date_to have a maximum range of 2 years only

If only date_from is provided, it will automatically set date_to to 6 months ahead of date_from

If only date_to is provided, it will automatically set date_from to 6 months back from date_to

if both are not provided, it will automatically set date_to to today and set date_from 6 months back from today

Production Endpoint: https://app.complyflow.com.au/app/public/index.php/api/acu/inspection 
Test Endpoint: https://test.complyflow.com.au/app/public/index.php/api/acu/inspection

Overview

This endpoint returns list of inspections from the current Organisation.

Authentication instructions

Refer to the Authentication method for Authentication Methods (for Login and Logout).

Permissions Required

The user should possess the permissions below:

  • API User

  • User is Staff

Please also refer to the Permissions Overview guide.

Query parameters

FIELD

TYPE

DESCRIPTION

Example

REQUIRED

DEFAULT

PATTERN

template

integer

Template ID

396

No

null

\d+

date_from

date

Filter for Inspection after this date

2024-04-09

No

null

YYYY-MM-DD

date_to

date

Filter for Inspection before this date

2024-04-10

No

null

YYYY-MM-DD

Request Example

curl --location 'http://shughi.complyflow.com/app/public/index.php/api/acu/inspection?template=396&date_from=2024-04-09&date_to=2024-04-10 \
--header 'Authorization: [...]' \
--header 'Cookie: [...]'

Response Example

The API Request returns a list of inspections from the current Organisation:

{
"token": "",
"data": [
{
"id": 37440,
"contractor_id": "",
"contractor_name": "",
"conducted_by": "wr er",
"staff_id": 692,
"project_id": "",
"project_name": "No Site",
"audit_program": "NZ Vehicle Inspection",
"date": "17-09-2024",
"status": "Completed",
"responsible": "Anyone",
"responsible_site": "Sydney CBD",
"responsible_staff_category": "HSE Inspectors",
"template_id": 286997,
"template_name": "NZ Vehicle Inspection Template",
"items": [
{
"id": 277181,
"action_required": "N",
"audit_category": "CNN Vehicle Safety Category 1"
],
"attendees": [
{
"name": "Abel Ramsey",
"staff_id": 3215,
"external_attendee": false
},
{
"name": "External 1",
"staff_id": null,
"external_attendee": true,
"company": "Comp",
"position": "Pos"
},
{
"name": "READ ONLY RIGHTS",
"staff_id": 653,
"external_attendee": false
}
]
}
]
}

Attendees Structure

The attendees array in the response includes all attendees in an inspection, with the following fields for each attendee:

  • name: Full name of the attendee

  • staff_id: Staff ID of the attendee (null for external attendees)

  • external_attendee: Boolean flag indicating whether the attendee is external (true) or internal (false)

  • position: Job title of the external attendee (only present for external attendees)

  • company: Company name of the external attendee (only present for external attendees)

Attendee Management

The system collects attendees from three possible sources:

  1. Internal staff members: Staff from the organisation who are assigned as attendee to the inspection

  2. External attendees: People from outside the organisation who assigned as external attendee in the inspection

  3. Inspection conductor: The staff who conducted the inspection is automatically included as an attendee if not already in the list

The API combines these into a single flat list for the response.

How Scheduled Inspections Work:

  • Scheduled inspections are included if they were added within the date range and remain open

  • This means you'll see:

    • Past and overdue scheduled inspections ✅

    • Today's scheduled inspections ✅

    • Tomorrow's scheduled inspections ✅

    • Scheduled inspections beyond tomorrow ❌

    • Auto-closed scheduled inspections ❌

The API returns inspections from the last 6 months through tomorrow by default, giving you visibility into recent activity plus immediate upcoming work.

Did this answer your question?