Skip to content

Latest commit

 

History

History
283 lines (201 loc) · 11.1 KB

TimeTrackingTimeEntriesApi.md

File metadata and controls

283 lines (201 loc) · 11.1 KB

timeular_api.TimeTrackingTimeEntriesApi

All URIs are relative to https://api.timeular.com/api/v2/

Method HTTP request Description
create_time_entry POST /time-entries Create Time Entry
delete_time_entry DELETE /time-entries/{timeEntryId} Delete a Time Entry
edit_time_entry PATCH /time-entries/{timeEntryId} Edit a Time Entry
get_time_entries_in_range GET /time-entries/{stoppedAfter}/{startedBefore} Find Time Entries in given range
get_time_entry GET /time-entries/{timeEntryId} Find Time Entry by its ID

create_time_entry

TimeEntryResponse create_time_entry(properties_of_a_new_time_entry=properties_of_a_new_time_entry)

Create Time Entry

With this endpoint, you can create a new Time Entry. It should be connected to an Activity and have a duration no shorter than 1 minute. A Note can be provided too, but it's not required. Within this Note, you can refer one or more Tags or Mentions, each of the prefixes must be configured with the start and the end index within the Note text and can be defined with a key. If key is not defined a random id will be generated and assigned. If you are referring to an existing Tag or Mention you can provide that key but the content of the Tag or Mention must be the same. If the related Activity is bound to some Integration, let's say JIRA Project, JIRA task IDs is a valid Tag too. Time Entry will be created even if it overlaps with other Time Entries – in result existing Time Entries will be split or deleted in such manner, that new one will fit without overlapping.

Example

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

# Configure API key authorization: AuthorizationHeader
configuration = timeular_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = timeular_api.TimeTrackingTimeEntriesApi(timeular_api.ApiClient(configuration))
properties_of_a_new_time_entry = timeular_api.TimeEntryCreationRequest() # TimeEntryCreationRequest | properties of a new Time Entry (optional)

try:
    # Create Time Entry
    api_response = api_instance.create_time_entry(properties_of_a_new_time_entry=properties_of_a_new_time_entry)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingTimeEntriesApi->create_time_entry: %s\n" % e)

Parameters

Name Type Description Notes
properties_of_a_new_time_entry TimeEntryCreationRequest properties of a new Time Entry [optional]

Return type

TimeEntryResponse

Authorization

AuthorizationHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

delete_time_entry

SuccessWithIgnoredErrorsResponse delete_time_entry(time_entry_id)

Delete a Time Entry

Example

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

# Configure API key authorization: AuthorizationHeader
configuration = timeular_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = timeular_api.TimeTrackingTimeEntriesApi(timeular_api.ApiClient(configuration))
time_entry_id = 'time_entry_id_example' # str | ID of a Time Entry, eg. `987`

try:
    # Delete a Time Entry
    api_response = api_instance.delete_time_entry(time_entry_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingTimeEntriesApi->delete_time_entry: %s\n" % e)

Parameters

Name Type Description Notes
time_entry_id str ID of a Time Entry, eg. `987`

Return type

SuccessWithIgnoredErrorsResponse

Authorization

AuthorizationHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

edit_time_entry

TimeEntryResponse edit_time_entry(time_entry_id, properties_to_change=properties_to_change)

Edit a Time Entry

With this endpoint you can edit existing Time Entry. When changing Activity ID please note, that both new and old Activity attached to Time Entry have to belong to same Integration. To remove a Note, just set the complete object to null and all values within the object will be deleted too.

Example

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

# Configure API key authorization: AuthorizationHeader
configuration = timeular_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = timeular_api.TimeTrackingTimeEntriesApi(timeular_api.ApiClient(configuration))
time_entry_id = 'time_entry_id_example' # str | ID of a Time Entry, eg. `987`
properties_to_change = timeular_api.TimeEntryEditionRequest() # TimeEntryEditionRequest | properties to change (optional)

try:
    # Edit a Time Entry
    api_response = api_instance.edit_time_entry(time_entry_id, properties_to_change=properties_to_change)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingTimeEntriesApi->edit_time_entry: %s\n" % e)

Parameters

Name Type Description Notes
time_entry_id str ID of a Time Entry, eg. `987`
properties_to_change TimeEntryEditionRequest properties to change [optional]

Return type

TimeEntryResponse

Authorization

AuthorizationHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

get_time_entries_in_range

TimeEntriesResponse get_time_entries_in_range(stopped_after, started_before)

Find Time Entries in given range

Find Time Entries which have at least one millisecond in common with provided time range.

Example

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

# Configure API key authorization: AuthorizationHeader
configuration = timeular_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = timeular_api.TimeTrackingTimeEntriesApi(timeular_api.ApiClient(configuration))
stopped_after = 'stopped_after_example' # str | Timestamp which matches all Time Entries stopped after it. Eg. `2017-01-01T00:00:00.000`.
started_before = 'started_before_example' # str | Timestamp which matches all Time Entries started before it. Eg. `2017-12-31T23:59:59.999`.

try:
    # Find Time Entries in given range
    api_response = api_instance.get_time_entries_in_range(stopped_after, started_before)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingTimeEntriesApi->get_time_entries_in_range: %s\n" % e)

Parameters

Name Type Description Notes
stopped_after str Timestamp which matches all Time Entries stopped after it. Eg. `2017-01-01T00:00:00.000`.
started_before str Timestamp which matches all Time Entries started before it. Eg. `2017-12-31T23:59:59.999`.

Return type

TimeEntriesResponse

Authorization

AuthorizationHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

get_time_entry

TimeEntryResponse get_time_entry(time_entry_id)

Find Time Entry by its ID

Example

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

# Configure API key authorization: AuthorizationHeader
configuration = timeular_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = timeular_api.TimeTrackingTimeEntriesApi(timeular_api.ApiClient(configuration))
time_entry_id = 'time_entry_id_example' # str | ID of a Time Entry, eg. `987`

try:
    # Find Time Entry by its ID
    api_response = api_instance.get_time_entry(time_entry_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingTimeEntriesApi->get_time_entry: %s\n" % e)

Parameters

Name Type Description Notes
time_entry_id str ID of a Time Entry, eg. `987`

Return type

TimeEntryResponse

Authorization

AuthorizationHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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