Skip to content

Departments

List of Departments

Endpoint: GET /api/departments

Retrieve a list of all departments. Optionally, include the deleted=true parameter to show departments that have been deleted.

URL

http
GET https://portal.innfinn.com/api/departments

Optional Parameters

  • deleted=true show deleted departments, e.g. /api/departments?deleted=true

Response Schema

  • id (string) Department ID.
  • name (string) Department name.
  • created_at (string) Date and time the department was created.
  • deleted_at (string) Date and time the department was deleted, if applicable.

Example Response

json
{
  "response": [
    {
      "id": "24090913152730",
      "name": "Call-center",
      "created_at": "2024-09-06 11:26:02",
      "deleted_at": null
    },
    {
      "id": "24090913158788",
      "name": "IT",
      "created_at": "2024-09-09 14:13:15",
      "deleted_at": null
    },
    {
      "id": "24090941313269",
      "name": "Cashiers",
      "created_at": "2024-09-09 09:41:31",
      "deleted_at": null
    }
  ]
}

Department Info

Endpoint: GET /api/department/{id}

Retrieve detailed information about a specific department by its ID.

URL

http
GET https://portal.innfinn.com/api/department/{id}

Example Response

json
{
  "response": {
    "id": "24090913158788",
    "name": "IT",
    "created_at": "2024-09-09 04:13:15",
    "deleted_at": null
  }
}

Create Department

Endpoint: POST /api/department

Create a new department by providing the name as a parameter.

URL

http
POST https://portal.innfinn.com/api/department

Parameters

  • name (string) Name of the new department.

Example Request

json
{
  "name": "IT"
}

Example Response

json
{
  "response": {
    "success": true,
    "id": "24090913158788"
  }
}

Edit Department

Endpoint: POST /api/department/{id}

Update the name of an existing department by its ID.

URL

http
POST https://portal.innfinn.com/api/department/{id}

Parameters

  • name (string) New name of the department.

Example Request

json
{
  "name": "IT department"
}

Example Response

json
{
  "response": {
    "success": true,
    "id": "24090913158788"
  }
}

Delete Department

Endpoint: DELETE /api/department/{id}

Delete a department by its ID.

URL

http
DELETE https://portal.innfinn.com/api/department/{id}

Example Response

json
{
  "response": {
    "success": true,
    "id": "24090913158788"
  }
}

Restore Department

Endpoint: GET /api/department/{id}/restore

Restore a previously deleted department by its ID.

URL

http
GET https://portal.innfinn.com/api/department/{id}/restore

Example Response

json
{
  "response": {
    "success": true,
    "id": "24090913158788"
  }
}