Skip to main content

Get All Risk

Support avatar
Written by Support
Updated over 12 months ago

GET [ risk ]

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

Overview

This endpoint returns a list of all risks that a staff can see.

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

  • One of the following:

    • User have View Risk Permission, or

    • User is a Risk Owner, or

    • User is assigned to Site Risk Action

Please also refer to the Permissions Overview guide.

Query parameters

FIELD

TYPE

DESCRIPTION

EXAMPLE

REQUIRED

DEFAULT

PATTERN

site

integer

Site ID

41

No

null

\d+

category_id

integer

Risk Category ID

1

No

null

\d+

risk_area_id

integer

Risk Area ID

1

No

null

\d+

status

integer

Risk Status in Site

1

No

null

1 → Not Controlled

2 → Partially Controlled

3 → Controlled

4 → Eliminated

5 → Pending

site, category_id, and risk_area_id parameter value can be seen from Client App > Risk Register > filter > Look for the query params on URL

  • hazard_categoryrisk_area_id

  • hazardcategory_id

  • projectsite

Request Example

curl --location 'http://test.complyflow.com.au/app/public/index.php/api/risk?site=41&category_id=1&risk_area_id=1&status=5' \
--header 'Authorization: [...]' \
--header 'Cookie: [...]'

Response Example

The API Request returns all list of risk that staff can see.

{
"token": "",
"data": [
{
"risk_id": 26,
"risk_name": "a",
"last_modified": "2023-10-24 20:58:41",
"risk_category": "aaaaav2",
"sites": [
{
"site_risk_id": 30,
"site_id": 41,
"risk_owner": "wr er",
"risk_status": "Pending",
"last_modified": "2023-10-24 20:58:41"
}
]
}
]
}

Did this answer your question?