POST [ audit/inspection-management/add-inspection-api ]
Production Endpoint: https://app.complyflow.com.au/app/public/index.php/audit/inspection-management/add-inspection-api
Test Endpoint: https://test.complyflow.com.au/app/public/index.php/audit/inspection-management/add-inspection-api
Overview
This endpoint adds an Inspection along with the categories, checklists & files.
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
Users have Access to View and Edit Inspection Permission
Please also refer to the Permissions Overview guide.
Body properties/Payload
FIELD | TYPE | DESCRIPTION | REQUIRED |
|
| Inspection Data Array | |
|
| Inspection Uploader | |
|
| Inspection will be assigned to this project | |
|
| required if the inspection is a plant inspection |
|
|
| The title of the inspection | |
|
| The date where inspection is conducted | |
|
| Inspection Template ID | |
|
| media array (Inspection Files) | |
|
| files attached to the inspection | |
|
| Inspection Attendees array | |
|
| Attendees name |
|
|
| checklist item array (can be more than 1 checklist) |
|
|
| checklist item’s code | |
|
| Status of checklist item, choose between |
|
|
| Checklist Item’s finding | |
|
| Checklist Item’s recommendation |
|
|
| checklist Item’s question (Required & needs to be exactly the same as in the template, otherwise the checklist will not be displayed) |
|
|
| Checklist item priority. Default to 0 | |
|
| Category of this checklist item (Required & needs to be exactly the same as in the template, otherwise the checklist will not be displayed) |
|
|
| checklist item files array |
|
|
| Files attached to the checklist item |
|
Request Example
curl --location 'http://test.complyflow.com.au/app/public/index.php/audit/inspection-management/add-inspection-api' \
--header 'Authorization: [...]' \
--header 'Cookie: [...]' \
--form 'inspectionData[id_staff]="%staff id%"' \
--form 'inspectionData[id_project]="123456"' \
--form 'inspectionData[id_plant]="123456"' \
--form 'inspectionData[title]="%dynamic title%"' \
--form 'inspectionData[date_added]="dd-mm-yy"' \
--form 'inspectionData[id_audit_template]="100"' \
--form 'media[0]=@"path/to/your/file1"' \
--form 'media[1]=@"path/to/your/file2"' \
--form 'media[2]=@"path/to/your/file3"' \
--form 'attendees[0]="%name%"' \
--form 'attendees[1]="%name%"' \
--form 'attendees[2]="%name%"' \
--form 'attendees[3]="%name%"' \
--form 'checklist[0][code]="123456"' \
--form 'checklist[0][pass_status]="1"' \
--form 'checklist[0][finding]="%finding%"' \
--form 'checklist[0][recommendation]="%recommendation%"' \
--form 'checklist[0][criteria]="%criteria%"' \
--form 'checklist[0][priority]="%priority number%"' \
--form 'checklist[0][audit_category]="category name"' \
--form 'checklist[0][files][0]=@"path/to/your/file1"' \
--form 'checklist[0][files][1]=@"path/to/your/file2"' \
--form 'checklist[0][files][2]=@"path/to/your/file3"'
Response Example
The API Request returns the status of this API action.
{
"status": "200",
"message": "Inspection Added successfully"
}
Response Information
Status | Response |
|
|
|
|



