Skip to main content

Get Project Sign Book data

Support avatar
Written by Support
Updated over 6 months ago

GET [ api/acu/psb ]

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

Overview

  • Method: GET

  • URI: api/acu/psb

  • Description: This endpoint returns the project sign book data and daily scans coming from ComplyFlow devices, filtered by date.

Authentication Instructions

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

  • Headers:

    • Authorization: Bearer <JWT_TOKEN> (string, required) - For jwt.auth middleware.

    • Accept: application/json (string, recommended)

Permissions Required

The user required 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

dateFrom

date

Filter for Project Sign Book after this date

2024-07-01

Yes

YYYY-MM-DD

dateTo

date

Filter for Project Sign Book before this date

2024-07-01

No

null

YYYY-MM-DD

Request Example

curl --location 'http://test.complyflow.com.au/app/public/index.php/api/acu/psb?dateFrom=2024-07-01&dateTo=2024-08-24' \
--header 'Authorization: [...]' \
--header 'Cookie: [...]'

Response Example

Success Response (200 OK)

  • Content-Type: application/json

  • Body:

{
"token": "string (A new JWT issued after invalidating the request's token)",
"data": [
{
"id": 3269,
"entity_type": "E",
"company": "asda123123123123123",
"contractor_id": 1554,
"employee_categories": [
"WorkCateAInside",
"WorkerCateB"
],
"date": "2024-07-11",
"long": "0.0",
"lat": "0.0",
"project": "projecta",
"total_hours": "20:00",
"flagged": 0
}
]
}

  • Type of the entity (entity_type) are:

    • E β†’ employee

    • S β†’ staff

  • ID field (id) is :

    • Employee ID when entity_type is E

    • Staff ID when entity_type is S

  • Contractor ID Field (contractor_id) only have value when entity_type is E otherwise will empty

  • Company Field (company) is :

    • Contractor name of that Employee when entity_type is E

    • Organisation name of that Staff when entity_type is S

  • Employee Categories Field (employee_categories) value is an array which containing all categories of employee which attach to that Employee while if it’s Staff then will just gives empty value

  • Flagged Field (flagged) – can have the following values :

    • 0 - accepted

    • 1 - rejected

    • Breathalyser

Error Responses

  • 401 Unauthorised (JWT Authentication Failed):

    • Triggered if the JWT is invalid, expired, or missing.

    • Response body structure depends on the jwt.auth middleware implementation (e.g., {"error": "token_expired"}).

  • 403 Forbidden:

    • Triggered if acu.auth middleware fails or if the authorize() method in ACUProjectSignBookIndexRequest returns false.

    • The authorize() method checks if the authenticated user profile hasApiAccess() and isStaff.

    • Response body structure may vary.

  • 422 Unprocessable Entity (Validation Failed by ACUProjectSignBookIndexRequest):

    • Content-Type: application/json

    • Body Examples:

      • If dateFrom is missing:

      {
      "token": "string (Refreshed JWT or original token)",
      "status": false,
      "error": "dateFrom is required",
      "error_code": 4
      }

      • If dateFrom format is incorrect:

      {
      "token": "string (Refreshed JWT or original token)",
      "status": false,
      "error": "dateFrom must be in Y-m-d format",
      "error_code": 4
      }

      • If dateTo format is incorrect:

      {
      "token": "string (Refreshed JWT or original token)",
      "status": false,
      "error": "dateTo must be in Y-m-d format",
      "error_code": 4
      }

Controller and Method

  • Controller: App\Api\Controllers\\ACUProjectSignBookController

  • Method: index(ACUProjectSignBookIndexRequest $request)

Did this answer your question?