Skip to main content

Get Inspection data v2

Support avatar
Written by Support
Updated this week

Overview

This endpoint returns a list of inspections from the current Organisation.

API Versions

The V1 endpoint is no longer supported and will be deprecated in Q1 2026

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

Version 2 - Recommended

New Endpoint: GET /api/acu/v2/inspection
  • Adds pagination to prevent timeouts with large datasets

  • v1 endpoint still works and remains available

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

Common Parameters (Both v1 and v2)

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

Additional v2 Parameters

FIELD

TYPE

DESCRIPTION

Example

REQUIRED

DEFAULT

PATTERN

page

integer

Page number

2

No

1

-

per_page

integer

Items per page

100

No

500

Max: 1000

Date Parameter Rules

  • 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

Request Example

Version 1

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: [...]'

Version 2

# Get first 500 inspections (default)
GET /api/acu/v2/inspection?date_from=2025-01-01

# Get 100 inspections per page
GET /api/acu/v2/inspection?date_from=2025-01-01&per_page=100

# Get page 2
GET /api/acu/v2/inspection?date_from=2025-01-01&page=2


Response Example

Version 1 Response

{
"token": "",
"data": [
{
"id": 37440,
"inspection_title": "Plant daily checklist - Public - Plant ID 847 - Sticker ID PSID0847",
"plant_id": 847,
"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
}
]
}
]
}

Version 2 Response

{
"data": [...],
"pagination": {
"current_page": 1,
"per_page": 500,
"total": 2450,
"total_pages": 5,
"next_page_url": "...&page=2...",
"prev_page_url": null
}
}

The data array structure is the same as v1. v2 adds the pagination object to help navigate large result sets.

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.

Version Recommendations

Use v2 when:

  • Working with large datasets (500+ inspections)

  • Need to prevent timeout issues

  • Want to implement pagination in your application

v1 is still suitable when:

  • Working with smaller datasets

  • Existing integrations that don't need pagination

  • Quick ad-hoc queries

Both versions return the same inspection data structure, so migration from v1 to v2 primarily involves handling the pagination response.

Did this answer your question?