Types of Work Resource

The following requests are supported for operations with types of work via actiTIME API:

GET/typesOfWork/{id}
GET/typesOfWork/default
GET/typesOfWork

Type of Work Properties

Type of work properties available via API:

Property Description
id Unique type of work identifier.
name Type of work name.
rate Rate set for type of work (system currency/mh).
archived Type of work status. Possible values: false (active), true (archived).
billable Billable category of type of work. Possible values: false (non-billable), true (billable).
default Shows whether the returned type of work is the default type or not. Possible values: false, true.

Required Permissions

All properties, except for the ‘rate’ property, are available to any user.

The ‘rate’ property is available only to the users with at least one of the following permissions:

  • Manage Accounts & Permissions;
  • Manage Cost & Billing Data;
  • Manage System Settings.

Retrieve Type of Work Properties

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

GET/typesOfWork/{id}

Example Request:

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

Example Response:

{
  "id": 15,
  "name": "management",
  "rate": null,
  "archived": false,
  "billable": false,
  "default": false
}

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

Retrieve Default Type of Work

Use the following request to retrieve the default type of work:

GET/typesOfWork/default

Example Request:

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

Example Response:

{
  "id": 1,
  "name": "engineering",
  "rate": 110,
  "archived": false,
  "billable": true,
  "default": true
}

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

Retrieve List of Types of Work

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

GET/typesOfWork

The request can be specified with several parameters:

Parameter Description
offset Pagination offset.
If provided, first n types of work will be not shown in the list.
limit Pagination limit.
If provided, number of returned types of work will be limited to n.
If not provided, default value (1000) is used.
ids If provided, only types of work with given IDs will be returned.
archived If provided, only active or only archived types of work will be returned.
If not provided, both active and archived types of work will be returned.
billable If provided, only non-billable or only billable types of work will be returned.
If not provided, both non-billable and billable will be returned.
name If provided, only the type of work with exact name match will be returned.
words If provided, only the type of work containing all given words in their names will be returned.
sort Sets sorting of the results.
Types of work can be sorted by name only.

Example Request:

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

Example Response:

{
  "offset": 3,
  "limit": 2,
  "items": [
    {
      "id": 2,
      "name": "non-billable",
      "rate": null,
      "archived": false,
      "billable": false,
      "default": false
    },
    {
      "id": 13,
      "name": "repair: complex",
      "rate": 95,
      "archived": false,
      "billable": true,
      "default": false
    }
  ]
}

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