Departments Resource

The following requests are supported for operations with departments via actiTIME API:

GET/departments/{id}
GET/departments

Department Properties

Department properties available via API:

Property Description
id Unique department identifier.
name Department’s name.
default Shows whether the returned department is the default department or not. Possible values: true, false.

Retrieve Department Properties

Use the following request to retrieve properties of the department with given ID:

GET/departments/{id}

Example Request:

curl -X GET "&ltactiTIME URL&gt/api/v1/departments/5" -H "accept: application/json; charset=UTF-8" -u "username:password"

Example Response:

{
  "id": 5,
  "name": "Top Management",
  "default": false
}

More info on using this request is available in Swagger at the following URL:
<your actiTIME URL>/api/v1/swagger

Retrieve List of Departments

Use the following request to retrieve a list of departments with their properties:

GET/departments

The request can be specified with several parameters:

Parameter Description
offset Pagination offset.
If provided, first n departments will be not shown in the list.
limit Pagination limit.
If provided, the number of returned departments will be limited to n.
If not provided, the default value (1000) is used.
name If provided, only the department with exact name match will be returned.
sort Sets sorting of the results.
Departments can be sorted by name only.

Example Request:

curl -X GET "&ltactiTIME URL&gt/api/v1/departments?offset=4&sort=%2Bname" -H "accept: application/json; charset=UTF-8" -u "username:password"

Example Response:

{
  "offset": 4,
  "limit": 1000,
  "items": [
    {
      "id": 5,
      "name": "Top Management",
      "default": false
    },
    {
      "id": -1,
      "name": "Users without department",
      "default": true
    }
  ]
}

More info on using this request is available in Swagger at the following URL:
<your actiTIME URL>/api/v1/swagger