The Clockwork API allows you to programmatically interacting with Clockwork data. For example, you could write automation to retrieve a list of worklogs at the end of every month and pass it into your invoicing service.
...
Code Block |
---|
https://api.clockwork.report/v1/worklogs?expand=issues,authors,emails,worklogs |
Response
Contains an array of worklogs for the specified scope. You can use:
The
expand=issues
query parameter to expand the response with issue details like Summary or Custom Fields. Otherwise you will receive only theissueId
.The
expand=authors
to expand the response with author details like Display Name. Otherwise you will receive only theaccountId
of the user.The
expand=emails
to expand response to include the worklog author’s email address.The
expand=worklogs
query parameter will fetch issue ID, worklog ID, time spent, and worklog attributes such as tags and billable hours.
API endpoints
All endpoints are currently hosted under https://api.clockwork.report/v1
. Add that prefix to each of the endpoints below.
...
Request query parameters
starting_at | The lower bound of the returned worklogs in the format of YYYY-MM-DD. |
ending_at | The upper bound of the returned worklogs in the format of YYYY-MM-DD. |
project_ids[] | Narrow down the returned worklogs to selected projects only. If both are provided, |
account_id | Narrow down the returned worklogs to the selected authors only.
|
expand | Comma-separated list of response parts to include. Currently supported expand item are: |
...
Code Block |
---|
curl 'https://api.clockwork.report/v1/worklogs' \ --get \ --data starting_at=2021-03-01 \ --data ending_at=2021-03-31 \ --data project_keys%5B%5D=SSP \ --data account_id=5ba374cab1a6ab2f054f17b1 \ --header 'Authorization: Token <TOKEN_HERE>' |
Response
Contains an array of worklogs for the specified scope. You can use:
...
The expand=issues
query parameter to expand the response with issue details like Summary or Custom Fields. Otherwise you will receive only the issue id
.
...
The expand=authors
to expand the response with author details like Display Name. Otherwise you will receive only the accountId
of the user.
...
EXAMPLE RESPONSE
Code Block |
---|
[ { "author": { "accountId": "5ba374cab1a6ab2f054f17b1" }, "id": "10685", "issue": { "id": "10118" }, "started": "2021-02-08T14:23:35Z", "timeSpentSeconds": 2700 } ] |
...
issue_id integer issue_key | Specify the issue you want to start a timer on. If both are provided, |
...
issue_id integer issue_key | Specify the issue you want to stop the timer on. If both are provided, |
...