API version 2 Office Departments

1. List Office Departments (api2/office_departments)

This method will return a list of office departments, including some default departments like 'Online', 'Client Address', and 'Other'. The collection will be in JSON format.

URL
Server URL HTTP type
UAT https://api-ca-uat.iinsightonline.com/api2/office_departments GET
PRODUCTION https://api-ca.iinsightonline.com/api2/office_departments GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Response
      
{
    "status": true,
    "message": "Office Departments retrieved successfully.",
    "total_records" => 19,
    "data": [
        {
            "id": "8",
            "name": "Usa office"
        },
        {
            "id": "2",
            "name": "Vancouver Office"
        },
        {
            "id": "1",
            "name": "Willoughby Office"
        },
        {
            "id": -3,
            "name": "Online"
        },
        {
            "id": -1,
            "name": "Client Address"
        },
        {
            "id": -2,
            "name": "Other"
        }
    ]
}
      
    
Errors

If an error occurs while retrieving the office departments, the response will contain an error message:

      
{
    "status": false,
    "message": "An error occurred while retrieving the data.",
    "error": "Detailed error message"
}