Skip to content

Latest commit

 

History

History
496 lines (371 loc) · 17.9 KB

ActivityApi.md

File metadata and controls

496 lines (371 loc) · 17.9 KB

kimai_python.ActivityApi

All URIs are relative to //demo-plugins.kimai.org/

Method HTTP request Description
api_activities_get GET /api/activities Returns a collection of activities
api_activities_id_get GET /api/activities/{id} Returns one activity
api_activities_id_meta_patch PATCH /api/activities/{id}/meta Sets the value of a meta-field for an existing activity
api_activities_id_patch PATCH /api/activities/{id} Update an existing activity
api_activities_id_rates_get GET /api/activities/{id}/rates Returns a collection of all rates for one activity
api_activities_id_rates_post POST /api/activities/{id}/rates Adds a new rate to an activity
api_activities_id_rates_rate_id_delete DELETE /api/activities/{id}/rates/{rateId} Deletes one rate for an activity
api_activities_post POST /api/activities Creates a new activity

api_activities_get

list[ActivityCollection] api_activities_get(project=project, projects=projects, visible=visible, globals=globals, globals_first=globals_first, order_by=order_by, order=order, term=term)

Returns a collection of activities

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
project = 'project_example' # str | Project ID to filter activities (optional)
projects = 'projects_example' # str | Comma separated list of project IDs to filter activities (optional)
visible = 'visible_example' # str | Visibility status to filter activities. Allowed values: 1=visible, 2=hidden, 3=all (default: 1) (optional)
globals = 'globals_example' # str | Use if you want to fetch only global activities. Allowed values: true (default: false) (optional)
globals_first = 'globals_first_example' # str | Deprecated parameter, value is not used any more (optional)
order_by = 'order_by_example' # str | The field by which results will be ordered. Allowed values: id, name, project (default: name) (optional)
order = 'order_example' # str | The result order. Allowed values: ASC, DESC (default: ASC) (optional)
term = 'term_example' # str | Free search term (optional)

try:
    # Returns a collection of activities
    api_response = api_instance.api_activities_get(project=project, projects=projects, visible=visible, globals=globals, globals_first=globals_first, order_by=order_by, order=order, term=term)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ActivityApi->api_activities_get: %s\n" % e)

Parameters

Name Type Description Notes
project str Project ID to filter activities [optional]
projects str Comma separated list of project IDs to filter activities [optional]
visible str Visibility status to filter activities. Allowed values: 1=visible, 2=hidden, 3=all (default: 1) [optional]
globals str Use if you want to fetch only global activities. Allowed values: true (default: false) [optional]
globals_first str Deprecated parameter, value is not used any more [optional]
order_by str The field by which results will be ordered. Allowed values: id, name, project (default: name) [optional]
order str The result order. Allowed values: ASC, DESC (default: ASC) [optional]
term str Free search term [optional]

Return type

list[ActivityCollection]

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_activities_id_get

ActivityEntity api_activities_id_get(id)

Returns one activity

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
id = 56 # int | Activity ID to fetch

try:
    # Returns one activity
    api_response = api_instance.api_activities_id_get(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ActivityApi->api_activities_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id int Activity ID to fetch

Return type

ActivityEntity

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_activities_id_meta_patch

ActivityEntity api_activities_id_meta_patch(id, body=body)

Sets the value of a meta-field for an existing activity

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
id = 56 # int | Activity record ID to set the meta-field value for
body = kimai_python.IdMetaBody() # IdMetaBody |  (optional)

try:
    # Sets the value of a meta-field for an existing activity
    api_response = api_instance.api_activities_id_meta_patch(id, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ActivityApi->api_activities_id_meta_patch: %s\n" % e)

Parameters

Name Type Description Notes
id int Activity record ID to set the meta-field value for
body IdMetaBody [optional]

Return type

ActivityEntity

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: /
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_activities_id_patch

ActivityEntity api_activities_id_patch(body, id)

Update an existing activity

Update an existing activity, you can pass all or just a subset of all attributes

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
body = kimai_python.ActivityEditForm() # ActivityEditForm | 
id = 56 # int | Activity ID to update

try:
    # Update an existing activity
    api_response = api_instance.api_activities_id_patch(body, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ActivityApi->api_activities_id_patch: %s\n" % e)

Parameters

Name Type Description Notes
body ActivityEditForm
id int Activity ID to update

Return type

ActivityEntity

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: /
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_activities_id_rates_get

list[ActivityRate] api_activities_id_rates_get(id)

Returns a collection of all rates for one activity

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
id = 56 # int | The activity whose rates will be returned

try:
    # Returns a collection of all rates for one activity
    api_response = api_instance.api_activities_id_rates_get(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ActivityApi->api_activities_id_rates_get: %s\n" % e)

Parameters

Name Type Description Notes
id int The activity whose rates will be returned

Return type

list[ActivityRate]

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_activities_id_rates_post

ActivityRate api_activities_id_rates_post(body, id)

Adds a new rate to an activity

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
body = kimai_python.ActivityRateForm() # ActivityRateForm | 
id = 56 # int | The activity to add the rate for

try:
    # Adds a new rate to an activity
    api_response = api_instance.api_activities_id_rates_post(body, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ActivityApi->api_activities_id_rates_post: %s\n" % e)

Parameters

Name Type Description Notes
body ActivityRateForm
id int The activity to add the rate for

Return type

ActivityRate

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: /
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_activities_id_rates_rate_id_delete

api_activities_id_rates_rate_id_delete(id, rate_id)

Deletes one rate for an activity

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
id = 56 # int | The activity whose rate will be removed
rate_id = 56 # int | The rate to remove

try:
    # Deletes one rate for an activity
    api_instance.api_activities_id_rates_rate_id_delete(id, rate_id)
except ApiException as e:
    print("Exception when calling ActivityApi->api_activities_id_rates_rate_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
id int The activity whose rate will be removed
rate_id int The rate to remove

Return type

void (empty response body)

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_activities_post

ActivityEntity api_activities_post(body)

Creates a new activity

Creates a new activity and returns it afterwards

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ActivityApi(kimai_python.ApiClient(configuration))
body = kimai_python.ActivityEditForm() # ActivityEditForm | 

try:
    # Creates a new activity
    api_response = api_instance.api_activities_post(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ActivityApi->api_activities_post: %s\n" % e)

Parameters

Name Type Description Notes
body ActivityEditForm

Return type

ActivityEntity

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: /
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]