easybill_client/generated/sync/docs/TimeTrackingApi.md
claudi caacb339dd Add unit tests for authentication and webhook parsing
- Implement tests for basic and bearer authentication headers in `test_auth.py`.
- Create tests for the `EasybillWebhookParser` in `test_webhooks.py`, covering JSON and form-encoded payloads, as well as a generic parse and acknowledgement method.
2026-04-17 10:20:12 +02:00

450 lines
16 KiB
Markdown

# easybill_generated_sync.TimeTrackingApi
All URIs are relative to *https://api.easybill.de/rest/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**time_trackings_get**](TimeTrackingApi.md#time_trackings_get) | **GET** /time-trackings | Fetch time trackings list
[**time_trackings_id_delete**](TimeTrackingApi.md#time_trackings_id_delete) | **DELETE** /time-trackings/{id} | Delete time tracking
[**time_trackings_id_get**](TimeTrackingApi.md#time_trackings_id_get) | **GET** /time-trackings/{id} | Fetch time tracking
[**time_trackings_id_put**](TimeTrackingApi.md#time_trackings_id_put) | **PUT** /time-trackings/{id} | Update time tracking
[**time_trackings_post**](TimeTrackingApi.md#time_trackings_post) | **POST** /time-trackings | Create time tracking
# **time_trackings_get**
> TimeTrackings time_trackings_get(limit=limit, page=page, login_id=login_id, project_id=project_id, date_from_at=date_from_at, date_thru_at=date_thru_at)
Fetch time trackings list
### Example
* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):
```python
import easybill_generated_sync
from easybill_generated_sync.models.time_trackings import TimeTrackings
from easybill_generated_sync.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_sync.Configuration(
host = "https://api.easybill.de/rest/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_sync.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'
# Enter a context with an instance of the API client
async with easybill_generated_sync.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = easybill_generated_sync.TimeTrackingApi(api_client)
limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional)
page = 56 # int | Set current Page. Default is 1. (optional)
login_id = 'login_id_example' # str | Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. (optional)
project_id = 'project_id_example' # str | Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. (optional)
date_from_at = 'date_from_at_example' # str | Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. (optional)
date_thru_at = 'date_thru_at_example' # str | Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. (optional)
try:
# Fetch time trackings list
api_response = await api_instance.time_trackings_get(limit=limit, page=page, login_id=login_id, project_id=project_id, date_from_at=date_from_at, date_thru_at=date_thru_at)
print("The response of TimeTrackingApi->time_trackings_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TimeTrackingApi->time_trackings_get: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional]
**page** | **int**| Set current Page. Default is 1. | [optional]
**login_id** | **str**| Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. | [optional]
**project_id** | **str**| Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. | [optional]
**date_from_at** | **str**| Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. | [optional]
**date_thru_at** | **str**| Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. | [optional]
### Return type
[**TimeTrackings**](TimeTrackings.md)
### Authorization
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
**429** | Too Many Requests | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **time_trackings_id_delete**
> time_trackings_id_delete(id)
Delete time tracking
### Example
* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):
```python
import easybill_generated_sync
from easybill_generated_sync.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_sync.Configuration(
host = "https://api.easybill.de/rest/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_sync.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'
# Enter a context with an instance of the API client
async with easybill_generated_sync.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = easybill_generated_sync.TimeTrackingApi(api_client)
id = 56 # int | ID of time tracking
try:
# Delete time tracking
await api_instance.time_trackings_id_delete(id)
except Exception as e:
print("Exception when calling TimeTrackingApi->time_trackings_id_delete: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| ID of time tracking |
### Return type
void (empty response body)
### Authorization
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | Successful operation | - |
**404** | Not found | - |
**429** | Too Many Requests | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **time_trackings_id_get**
> TimeTracking time_trackings_id_get(id)
Fetch time tracking
### Example
* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):
```python
import easybill_generated_sync
from easybill_generated_sync.models.time_tracking import TimeTracking
from easybill_generated_sync.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_sync.Configuration(
host = "https://api.easybill.de/rest/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_sync.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'
# Enter a context with an instance of the API client
async with easybill_generated_sync.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = easybill_generated_sync.TimeTrackingApi(api_client)
id = 56 # int | ID of time tracking
try:
# Fetch time tracking
api_response = await api_instance.time_trackings_id_get(id)
print("The response of TimeTrackingApi->time_trackings_id_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TimeTrackingApi->time_trackings_id_get: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| ID of time tracking |
### Return type
[**TimeTracking**](TimeTracking.md)
### Authorization
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
**404** | Not found | - |
**429** | Too Many Requests | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **time_trackings_id_put**
> TimeTracking time_trackings_id_put(id, body)
Update time tracking
### Example
* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):
```python
import easybill_generated_sync
from easybill_generated_sync.models.time_tracking import TimeTracking
from easybill_generated_sync.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_sync.Configuration(
host = "https://api.easybill.de/rest/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_sync.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'
# Enter a context with an instance of the API client
async with easybill_generated_sync.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = easybill_generated_sync.TimeTrackingApi(api_client)
id = 56 # int | ID of time tracking
body = easybill_generated_sync.TimeTracking() # TimeTracking |
try:
# Update time tracking
api_response = await api_instance.time_trackings_id_put(id, body)
print("The response of TimeTrackingApi->time_trackings_id_put:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TimeTrackingApi->time_trackings_id_put: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **int**| ID of time tracking |
**body** | [**TimeTracking**](TimeTracking.md)| |
### Return type
[**TimeTracking**](TimeTracking.md)
### Authorization
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
**400** | Invalid time tracking | - |
**429** | Too Many Requests | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **time_trackings_post**
> TimeTracking time_trackings_post(body)
Create time tracking
### Example
* Basic Authentication (basicAuth):
* Api Key Authentication (Bearer):
```python
import easybill_generated_sync
from easybill_generated_sync.models.time_tracking import TimeTracking
from easybill_generated_sync.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = easybill_generated_sync.Configuration(
host = "https://api.easybill.de/rest/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = easybill_generated_sync.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: Bearer
configuration.api_key['Bearer'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Bearer'] = 'Bearer'
# Enter a context with an instance of the API client
async with easybill_generated_sync.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = easybill_generated_sync.TimeTrackingApi(api_client)
body = easybill_generated_sync.TimeTracking() # TimeTracking |
try:
# Create time tracking
api_response = await api_instance.time_trackings_post(body)
print("The response of TimeTrackingApi->time_trackings_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TimeTrackingApi->time_trackings_post: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**TimeTracking**](TimeTracking.md)| |
### Return type
[**TimeTracking**](TimeTracking.md)
### Authorization
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | Successful operation | - |
**429** | Too Many Requests | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)