Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


NameDescription
1

Anchor
Add department
Add department
Add department

Panel
borderColorblack
bgColor#fbfff5
borderStylesolid
Add a new department.

Name

Description
URL/department
HTTP MethodPOST
Body Parameters
ParameterDescription
idDepartment ID.
nameDepartment name.
descriptionDescription of department.
Sample Response
Code Block
languagejs
{
  "id": "apiTestDept",
  "name": "API TEST Department",
  "description": "This is a department created by API."
}
2

Anchor
Delete department
Delete department
Delete department

Panel
borderColorblack
bgColor#fbfff5
borderStylesolid
Delete a department via department ID.

Name

Description
URL/department/{id}
HTTP MethodDELETE
Path Parameters
ParameterDescription
idDepartment ID.
Sample Response
Code Block
languagejs
{
  "date": "Wed Aug 28 01:29:38 SGT 2019",
  "code": "200",
  "message": "Successful operation"
}
3

Anchor
Find department
Find department
Find department

Panel
borderColorblack
bgColor#fbfff5
borderStylesolid

Gets all departments from all organizations by default.

Able to filter or sort the returned results via parameters.

Name

Description
URL/department/find
HTTP MethodGET
Query String Parameters
ParameterDescription
nameFilterFilters the response via department ID.
organizationIdFilter departments that belong to an organization, via organization ID.
sort

Department data column to sort.

Must be used in conjunction with "sortDescending" parameter.

sortDescending

Sort the specified "sort" parameter value in ascending or descending order.

Expects a boolean value.

Must be used in conjunction with "sort" parameter.

startOffsetStarting position of records to start query. Expects an integer.
pageSizeNumber of results to return. Expects an integer.
Sample Response
Code Block
languagejs
[
  {
    "id": "D-001",
    "name": "CEO Office",
    "description": ""
  },
  {
    "id": "D-002",
    "name": "Human Resource and Admin",
    "description": ""
  },
	.....
]
4

Anchor
Get department by ID
Get department by ID
Get department by ID

Panel
borderColorblack
bgColor#fbfff5
borderStylesolid
Get details of a department via department ID.

Name

Description
URL/department/{id}
HTTP MethodGET
Path Parameters
ParameterDescription
idDepartment ID.
Sample Response
Code Block
languagejs
{
  "id": "D-001",
  "name": "CEO Office",
  "description": ""
}
5

Anchor
Update department
Update department
Update department

Panel
borderColorblack
bgColor#fbfff5
borderStylesolid
Update the details of a department.

Name

Description
URL/department
HTTP MethodPUT
Body Parameters
ParameterDescription
idDepartment ID.
nameDepartment name.
descriptionDescription of department.
Sample Response
Code Block
languagejs
{
  "id": "apiTestDept",
  "name": "API TEST Department",
  "description": "I update this department description via API."
}

...