Work Report
Work reports (time sheets)
The WorkReport object
A work report is basically a time sheet. It contains work hours, how many hours are to be invoiced (if different), possibly other items. They typically include a reference to a customer (and optionally project) to be invoiced. If the work done is a result of a job, a reference to that is included too.
Attributes
This table does not include attributes that are considered trivial or self-explanatory. See also common attributes.
Attribute | Description |
---|---|
description | Brief description of the work done. |
workDuration | Duration of work, in minutes. |
invoicedWorkDuration | Duration of work to be invoiced, in minutes. |
pauseDuration | Pause (lunch break etc) duration, in minutes. It should make sense that endTime - startTime - pauseDuration = workDuration... |
items | Items, or rows, on this work report. If a work report contains items, workDuration and invoicedWorkDuration must be null, and instead specified in an item with unit=HOURS. |
items.amount, items.invoicedAmount | Work duration/distance/price/number depending on the value of items.unit. Floating point value. Note that durations are specified as hours. |
items.unit | Unit for this item. Valid values: HOURS, KM, ITEMS, MONEY, DAY, MONTH, KG, GRAM, TON, METER, MM, M2, M3, LITRE . |
Example
Get work reports
Get all work reports, or (preferably) a filtered set (see query parameters).
Query Parameters
Parameter | Description | Type | Example |
---|---|---|---|
customers | A comma-separated list of customer IDs | IdList | 1234,5678 |
projects | A comma-separated list of project IDs | IdList | 1234,5678 |
users | A comma-separated list of user IDs | IdList | 1234,5678 |
from | Date/time to include work reports from | Timestamp | 1359673200000 |
to | Date/time to include work reports up to | Timestamp | 1362092400000 |
invoiced | Include invoiced work reports | Flag | |
limit | Limit the number of returned objects | Integer | |
offset | Skip the first N objects | Integer | |
modified | Include only objects modified since this date/timestamp | Timestamp | 2015-10-05 |
Example
GET /workreport?customers=123456&users=789123&invoiced
- Method
- GET
- URL
- /workreport
- Authentication
- Key/Token
- Response
- Array of WorkReport
Search work reports
Search work reports. Please note that the search representation contains only a subset of the detail and list representations.
Query Parameters
q |
Search query. Required.
The default search behavior is an ElasticSearch query, each search term ORed, with some fields boosted.
|
Example
GET /workreport/search?q=troubleshoot Content-type: application/json
- Method
- GET
- URL
- /workreport/search
- Authentication
- Token
- Response
- WorkReportSearchEntry object
Get a work report
Get a specific work report by ID or UUID
- Method
- GET
- URL
- /workreport/:id
- Authentication
- Key/Token
- Response
- WorkReport object
Create a work report
Create a work report. The work report will be assigned a server-generated ID and UUID.
- Method
- POST
- URL
- /workreport
- Authentication
- Key/Token
- Request
- WorkReport object
- Response
- WorkReport object
Update or create a work report
Update an existing work report or create it (if it doesn't exist and :id is a UUID).
Example
PUT /workreport/0847ed17-b060-4599-a38c-be9a8b9cbb34
{ ... }
Response
The updated work report object.
- Method
- PUT
- URL
- /workreport/:id
- Authentication
- Key/Token
- Request
- WorkReport object
- Response
- WorkReport object
Delete a work report
Delete a work report.
Example
DELETE /workreport/0847ed17-b060-4599-a38c-be9a8b9cbb34
- Method
- DELETE
- URL
- /workreport/:id
- Authentication
- Key/Token
- Response
- Status code only
Mark a work report invoiced
Mark a work report as invoiced. The work report's invoicedById will be the calling token user (if any) and invoicedTimeStamp the timestamp of the call.
Note: This cannot be undone.
Example
PUT /workreport/0847ed17-b060-4599-a38c-be9a8b9cbb34/invoice
- Method
- PUT
- URL
- /workreport/:id/invoice
- Authentication
- Key/Token
- Response
- Status code only