api_interface
main.Clockify.api_interface
¤
Clockify API Interface Module.
Classes¤
ClockifyAPI(api_key, workspace_id)
¤
A class to interact with the Clockify API for project management.
Initialize the ClockifyAPI instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key
|
str
|
Your personal Clockify API key. |
required |
workspace_id
|
str
|
The ID of the Clockify workspace to interact with. |
required |
Source code in main/Clockify/api_interface.py
12 13 14 15 16 17 18 19 20 21 22 23 |
|
Functions¤
get_time_entries(payload)
¤
Retrieve detailed time entries for a specified workspace using the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
payload
|
dict[str, Collection[str]]
|
A dictionary containing filter parameters for the time entries. |
required |
Example payload
{ "dateRangeStart": "2024-09-01T00:00:00.000Z", "dateRangeEnd": "2025-01-01T23:59:59.000Z", "detailedFilter": { "page": 1, "pageSize": 200 }, "projects": { "contains": "CONTAINS", "ids": [ "6694bb8babec074beb0731cb" ] } }
Returns:
Name | Type | Description |
---|---|---|
dict |
dict[str, object]
|
The JSON response from the API containing the time entries data. |
Raises:
Type | Description |
---|---|
HTTPError
|
If the API request fails. |
Source code in main/Clockify/api_interface.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|