Skip to content

Latest commit

 

History

History
380 lines (270 loc) · 12.4 KB

TimeTrackingDevicesApi.md

File metadata and controls

380 lines (270 loc) · 12.4 KB

timeular_api.TimeTrackingDevicesApi

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

Method HTTP request Description
activate_device POST /devices/{deviceSerial}/active Sets the status of a Device to active
deactivate_device DELETE /devices/{deviceSerial}/active Removes the active status from the given Device
disable_device POST /devices/{deviceSerial}/disabled Disable a Device
edit_device PATCH /devices/{deviceSerial} Edit a Device
enable_device DELETE /devices/{deviceSerial}/disabled Enable a Device
get_known_devices GET /devices List all known Devices
remove_device DELETE /devices/{deviceSerial} Remove known Device

activate_device

DeviceResponse activate_device(device_serial)

Sets the status of a Device to active

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.TimeTrackingDevicesApi(timeular_api.ApiClient(configuration))
device_serial = 'device_serial_example' # str | Serial number of a Device

try:
    # Sets the status of a Device to active
    api_response = api_instance.activate_device(device_serial)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingDevicesApi->activate_device: %s\n" % e)

Parameters

Name Type Description Notes
device_serial str Serial number of a Device

Return type

DeviceResponse

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]

deactivate_device

DeviceResponse deactivate_device(device_serial)

Removes the active status from the given Device

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.TimeTrackingDevicesApi(timeular_api.ApiClient(configuration))
device_serial = 'device_serial_example' # str | Serial number of a Device

try:
    # Removes the active status from the given Device
    api_response = api_instance.deactivate_device(device_serial)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingDevicesApi->deactivate_device: %s\n" % e)

Parameters

Name Type Description Notes
device_serial str Serial number of a Device

Return type

DeviceResponse

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]

disable_device

DeviceResponse disable_device(device_serial)

Disable a Device

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.TimeTrackingDevicesApi(timeular_api.ApiClient(configuration))
device_serial = 'device_serial_example' # str | Serial number of a Device

try:
    # Disable a Device
    api_response = api_instance.disable_device(device_serial)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingDevicesApi->disable_device: %s\n" % e)

Parameters

Name Type Description Notes
device_serial str Serial number of a Device

Return type

DeviceResponse

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_device

DeviceResponse edit_device(device_serial, properties_to_change=properties_to_change)

Edit a Device

With this endpoint, you can set a name of your Device. The Name is trimmed automatically from leading and trailing whitespaces. You can remove name from a Device by setting it to the value null, blank or empty.

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.TimeTrackingDevicesApi(timeular_api.ApiClient(configuration))
device_serial = 'device_serial_example' # str | Serial number of a Device
properties_to_change = timeular_api.DeviceEditionRequest() # DeviceEditionRequest | properties to change (optional)

try:
    # Edit a Device
    api_response = api_instance.edit_device(device_serial, properties_to_change=properties_to_change)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingDevicesApi->edit_device: %s\n" % e)

Parameters

Name Type Description Notes
device_serial str Serial number of a Device
properties_to_change DeviceEditionRequest properties to change [optional]

Return type

DeviceResponse

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]

enable_device

DeviceResponse enable_device(device_serial)

Enable a Device

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.TimeTrackingDevicesApi(timeular_api.ApiClient(configuration))
device_serial = 'device_serial_example' # str | Serial number of a Device

try:
    # Enable a Device
    api_response = api_instance.enable_device(device_serial)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingDevicesApi->enable_device: %s\n" % e)

Parameters

Name Type Description Notes
device_serial str Serial number of a Device

Return type

DeviceResponse

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_known_devices

DevicesResponse get_known_devices()

List all known Devices

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.TimeTrackingDevicesApi(timeular_api.ApiClient(configuration))

try:
    # List all known Devices
    api_response = api_instance.get_known_devices()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TimeTrackingDevicesApi->get_known_devices: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

DevicesResponse

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]

remove_device

remove_device(device_serial)

Remove known Device

With this endpoint, you can remove a Device from list of known Devices. In order to remove the Device, you have to make it active again with POST request to /api/v2//devices/{deviceSerial}/active.

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.TimeTrackingDevicesApi(timeular_api.ApiClient(configuration))
device_serial = 'device_serial_example' # str | Serial number of a Device

try:
    # Remove known Device
    api_instance.remove_device(device_serial)
except ApiException as e:
    print("Exception when calling TimeTrackingDevicesApi->remove_device: %s\n" % e)

Parameters

Name Type Description Notes
device_serial str Serial number of a Device

Return type

void (empty response body)

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]