Scaling an IoT deployment? Join our webinar on May 28th where we dive into real-world scaling pain points and how to overcome them.

Blues Developers
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Button IconHelp
Notehub StatusVisit our Forum
Button IconSign In
Sign In
Sign In
Docs Home
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Tools & SDKs
Notecard CLI
Firmware Libraries
Libraries Overview
Arduino Library
Python Library
Zephyr Library
Notehub SDKs
SDKs Overview
Notehub JS Library
Notehub Py Library
InstallationUsageAuthorization APIBilling Account APIDevice APIEvent APIMonitor APIProject APIRoute API
homechevron_rightDocschevron_rightTools & SDKschevron_rightNotehub Sdkschevron_rightNotehub Py Library Installation and Usage

Notehub Py Library Overview

The Notehub Py library is a PyPI library built specifically for use in Python-based applications.

It is designed to get you connected to the Notehub API quickly, and allow you to access all the API routes relevant to interacting with Notehub in a Python-friendly way.

Installation

You can install the Notehub Py library in any Python-based application using the steps below.

In the root of the project where you wish to use Notehub Py, run the following command from the terminal.

Using pip via PyPI:

$
python3 -m pip install notehub-py

Once the package is installed, you can import the library using import:

Using import:

import notehub_py

Usage

Below is documentation and code examples for all the Notehub API methods.

Notehub Py Authorization

There is one main type of authorization the Notehub API uses for nearly all requests:

API Key

The api_key referenced in the following code examples is an API key (also known locally as an X-Session-Token).

The API key is an authentication token that can be obtained in two ways:

Manually cURL the token from the command line

Using the command line, a user can request a new token from the Notehub API /auth/login endpoint using a Notehub username and password in the body of the request.

Use notehub_py.AuthorizationApi login

Using the Notehub Py library, a user can programmatically call the Notehub API's /auth/login endpoint via the notehub_py.AuthorizationApi's login() method while supplying a Notehub username and password in the loginRequest object.

Usage Limits

Be aware that the Notehub API has usage limits, and after you exceed the request threshold you may receive 429 response codes from your requests. For more information see Notehub API Usage Limits.

note

All URIs are relative to https://api.notefile.net

Authorization API

MethodHTTP Request
loginPOST /auth/login

This is the only Notehub API call that does not require some form of authentication token, and it is used to generate the token which can then be used for almost all subsequent API requests.

login

Gets a session token from the API from a username and password.

Example

import notehub_py
from notehub_py.models.login200_response import Login200Response
from notehub_py.models.login_request import LoginRequest
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.AuthorizationApi(api_client)
    login_request = {"username":"name@example.com","password":"test-password"} # LoginRequest | 

    try:
        api_response = api_instance.login(login_request)
        print("The response of AuthorizationApi->login:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuthorizationApi->login: %s\n" % e)

Parameters

NameTypeDescriptionNotes
login_requestLoginRequest

LoginRequest Properties

NameTypeDescriptionNotes
usernamestr[optional]
passwordstr[optional]

Authorization

No authorization required

Billing Account API

MethodHTTP Request
get_billing_accountsGET /v1/billing-accounts

get_billing_accounts

Get Billing Accounts accessible by the api_key

Example

import notehub_py
from notehub_py.models.get_billing_accounts200_response import GetBillingAccounts200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.BillingAccountApi(api_client)

    try:
        api_response = api_instance.get_billing_accounts()
        print("The response of BillingAccountApi->get_billing_accounts:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BillingAccountApi->get_billing_accounts: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

Successful 200 get_billing_accounts response

Authorization

api_key

Device API

MethodHTTP Request
delete_device_environment_variableDELETE /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables/\{key\}
delete_project_deviceDELETE /v1/projects/{projectUID}/devices/{deviceUID}
disable_devicePOST /v1/projects/{projectUID}/devices/{deviceUID}/disable
disable_device_connectivity_assurancePOST /v1/projects/{projectUID}/devices/{deviceUID}/disable-connectivity-assurance
enable_devicePOST /v1/projects/{projectUID}/devices/{deviceUID}/enable
enable_device_connectivity_assurancePOST /v1/projects/{projectUID}/devices/{deviceUID}/enable-connectivity-assurance
get_deviceGET /v1/projects/{projectUID}/devices/{deviceUID}
get_device_environment_variablesGET /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables
get_device_environment_variables_by_pinGET /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin
get_device_health_logGET /v1/projects/{projectUID}/devices/{deviceUID}/health-log
get_device_latestGET /v1/projects/{projectUID}/devices/{deviceUID}/latest
get_device_public_keyGET /v1/projects/{projectUID}/devices/{deviceUID}/public-key
get_device_sessionsGET /v1/projects/{projectUID}/devices/{deviceUID}/sessions
get_project_device_public_keysGET /v1/projects/{projectUID}/devices/public-keys
get_project_devicesGET /v1/projects/{projectUID}/devices
get_project_fleet_devicesGET /v1/projects/{projectUID}/fleets/{fleetUID}/devices
handle_note_addPOST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}
handle_note_changesGET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/changes
handle_note_create_addPOST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
handle_note_deleteDELETE /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
handle_note_getGET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
handle_note_signalPOST /v1/projects/{projectUID}/devices/{deviceUID}/signal
handle_note_updatePUT /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
handle_notefile_changesGET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes
handle_notefile_changes_pendingGET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes/pending
handle_notefile_deleteDELETE /v1/projects/{projectUID}/devices/{deviceUID}/files
post_provision_project_devicePOST /v1/projects/{projectUID}/devices/{deviceUID}/provision
put_device_environment_variablesPUT /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables
put_device_environment_variables_by_pinPUT /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin

delete_device_environment_variable

Delete environment variable of a device

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    key = "key_example" # str | The environment variable key to delete.

    try:
        api_response = api_instance.delete_device_environment_variable(project_uid, device_uid, key)
        print("The response of DeviceApi->delete_device_environment_variable:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->delete_device_environment_variable: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
keystrThe environment variable key to delete.

Return type

Successful 200 delete_device_environment_variable response

Authorization

api_key

delete_project_device

Delete Device

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    purge = False # bool |  (default to False)

    try:
        api_instance.delete_project_device(project_uid, device_uid, purge)
    except Exception as e:
        print("Exception when calling DeviceApi->delete_project_device: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
purgebool[default to False]

Return type

void (empty response body)

Authorization

api_key

disable_device

Disable Device

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_instance.disable_device(project_uid, device_uid)
    except Exception as e:
        print("Exception when calling DeviceApi->disable_device: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

void (empty response body)

Authorization

api_key

disable_device_connectivity_assurance

Disable Connectivity Assurance

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_instance.disable_device_connectivity_assurance(project_uid, device_uid)
    except Exception as e:
        print("Exception when calling DeviceApi->disable_device_connectivity_assurance: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

void (empty response body)

Authorization

api_key

enable_device

Enable Device

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_instance.enable_device(project_uid, device_uid)
    except Exception as e:
        print("Exception when calling DeviceApi->enable_device: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

void (empty response body)

Authorization

api_key

enable_device_connectivity_assurance

Enable Connectivity Assurance

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_instance.enable_device_connectivity_assurance(project_uid, device_uid)
    except Exception as e:
        print("Exception when calling DeviceApi->enable_device_connectivity_assurance: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

void (empty response body)

Authorization

api_key

get_device

Get Device

Example

import notehub_py
from notehub_py.models.device import Device
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_response = api_instance.get_device(project_uid, device_uid)
        print("The response of DeviceApi->get_device:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_device: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

Successful 200 get_device response

Authorization

api_key

get_device_environment_variables

Get environment variables of a device

Example

import notehub_py
from notehub_py.models.get_device_environment_variables200_response import GetDeviceEnvironmentVariables200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_response = api_instance.get_device_environment_variables(project_uid, device_uid)
        print("The response of DeviceApi->get_device_environment_variables:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_device_environment_variables: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

Successful 200 get_device_environment_variables response

Authorization

api_key

get_device_environment_variables_by_pin

Get environment variables of a device with device pin authorization

Example

import notehub_py
from notehub_py.models.get_device_environment_variables200_response import GetDeviceEnvironmentVariables200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: pin
configuration.api_key["pin"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    product_uid = "com.blues.bridge:sensors" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_response = api_instance.get_device_environment_variables_by_pin(product_uid, device_uid)
        print("The response of DeviceApi->get_device_environment_variables_by_pin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_device_environment_variables_by_pin: %s\n" % e)

Parameters

NameTypeDescriptionNotes
product_uidstr
device_uidstr

Authorization

pin

get_device_health_log

Get Device Health Log

Example

import notehub_py
from notehub_py.models.get_device_health_log200_response import GetDeviceHealthLog200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_response = api_instance.get_device_health_log(project_uid, device_uid)
        print("The response of DeviceApi->get_device_health_log:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_device_health_log: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project _uidstr
device_uidstr

Return type

Successful 200 get_device_health_log response

Authorization

api_key

get_device_latest

Get Device Latest Events

Example

import notehub_py
from notehub_py.models.get_device_latest200_response import GetDeviceLatest200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_response = api_instance.get_device_latest(project_uid, device_uid)
        print("The response of DeviceApi->get_device_latest:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_device_latest: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

Successful 200 get_device_latest response

Authorization

api_key

get_device_public_key

Get Device Public Key

Example

import notehub_py
from notehub_py.models.get_device_public_key200_response import GetDevicePublicKey200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_response = api_instance.get_device_public_key(project_uid, device_uid)
        print("The response of DeviceApi->get_device_public_key:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_device_public_key: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Authorization

api_key

get_device_sessions

Get Device Sessions

Example

import notehub_py
from notehub_py.models.get_device_sessions200_response import GetDeviceSessions200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)

    try:
        api_response = api_instance.get_device_sessions(project_uid, device_uid, page_size=page_size, page_num=page_num)
        print("The response of DeviceApi->get_device_sessions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_device_sessions: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]

Return type

Successful 200 get_device_sessions response

Authorization

api_key

get_project_device_public_keys

Get Device Public Keys of a Project

Example

import notehub_py
from notehub_py.models.get_project_device_public_keys200_response import GetProjectDevicePublicKeys200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)

    try:
        api_response = api_instance.get_project_device_public_keys(project_uid, page_size=page_size, page_num=page_num)
        print("The response of DeviceApi->get_project_device_public_keys:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_project_device_public_keys: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]

Authorization

api_key

get_project_devices

Get Devices of a Project

Example

import notehub_py
from notehub_py.models.get_project_devices200_response import GetProjectDevices200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
    tag = ["tag_example"] # List[str] | Tag filter (optional)
    serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
    fleet_uid = ["fleet_uid_example"] # List[str] |  (optional)
    notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
    location = ["location_example"] # List[str] | Location filter (optional)
    host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
    product_uid = ["product_uid_example"] # List[str] |  (optional)
    sku = ["sku_example"] # List[str] | SKU filter (optional)

    try:
        api_response = api_instance.get_project_devices(project_uid, page_size=page_size, page_num=page_num)
        print("The response of DeviceApi->get_project_devices:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_project_devices: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]
device_uidList[str]A Device UID.[optional]
tagList[str]Tag filter[optional]
serial_numberList[str]Serial number filter[optional]
fleet_uidList[str][optional]
notecard_firmwareList[str]Firmware version filter[optional]
locationList[str]Location filter[optional]
host_firmwareList[str]Host firmware filter[optional]
product_uidList[str][optional]
skuList[str]SKU filter[optional]

Return type

Successful 200 get_project_devices response

Authorization

api_key

get_project_fleet_devices

Get Devices of a Fleet within a Project

Example

import notehub_py
from notehub_py.models.get_project_devices200_response import GetProjectDevices200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
    tag = ["tag_example"] # List[str] | Tag filter (optional)
    serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
    notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
    location = ["location_example"] # List[str] | Location filter (optional)
    host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
    product_uid = ["product_uid_example"] # List[str] |  (optional)
    sku = ["sku_example"] # List[str] | SKU filter (optional)

    try:
        api_response = api_instance.get_project_fleet_devices(project_uid, fleet_uid, page_size=page_size, page_num=page_num)
        print("The response of DeviceApi->get_project_fleet_devices:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->get_project_fleet_devices: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]
device_uidList[str]A Device UID.[optional]
tagList[str]Tag filter[optional]
serial_numberList[str]Serial number filter[optional]
notecard_firmwareList[str]Firmware version filter[optional]
locationList[str]Location filter[optional]
host_firmwareList[str]Host firmware filter[optional]
product_uidList[str][optional]
skuList[str]SKU filter[optional]

Return type

Successful 200 get_project_fleet_devices response

Authorization

api_key

handle_note_add

Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist.

Example

import notehub_py
from notehub_py.models.note import Note
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    notefile_id = "notefile_id_example" # str | 
    note = notehub_py.Note() # Note | Body or payload of note to be added to the device

    try:
        api_instance.handle_note_add(project_uid, device_uid, notefile_id, note)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_note_add: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
notefile_idstr
noteNoteBody or payload of note to be added to the device

Note Properties

NameTypeDescriptionNotes
bodyobject[optional]
payloadstr[optional]

Return type

void (empty response body)

Authorization

api_key

handle_note_changes

Incrementally retrieve changes within a specific Notefile.

Example

import notehub_py
from notehub_py.models.handle_note_changes200_response import HandleNoteChanges200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    notefile_id = "notefile_id_example" # str | 
    tracker = "tracker_example" # str | The change tracker ID. (optional)
    max = 56 # int | The maximum number of Notes to return in the request. (optional)
    start = True # bool | true to reset the tracker to the beginning. (optional)
    stop = True # bool | true to delete the tracker. (optional)
    deleted = True # bool | true to return deleted notes. (optional)
    delete = True # bool | true to delete the notes returned by the request. (optional)

    try:
        api_response = api_instance.handle_note_changes(project_uid, device_uid, notefile_id, tracker=tracker, max=max, start=start, stop=stop, deleted=deleted, delete=delete)
        print("The response of DeviceApi->handle_note_changes:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_note_changes: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
notefile_idstr
trackerstrThe change tracker ID.[optional]
maxintThe maximum number of Notes to return in the request.[optional]
startbooltrue to reset the tracker to the beginning.[optional]
stopbooltrue to delete the tracker.[optional]
deletedbooltrue to return deleted notes.[optional]
deletebooltrue to delete the notes returned by the request.[optional]

Return type

Successful 200 handle_note_changes response

Authorization

api_key

handle_note_create_add

Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist.

Example

import notehub_py
from notehub_py.models.note import Note
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    notefile_id = "notefile_id_example" # str | 
    note_id = "note_id_example" # str | 
    note = notehub_py.Note() # Note | Body or payload of note to be added to the device

    try:
        api_instance.handle_note_create_add(project_uid, device_uid, notefile_id, note_id, note)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_note_create_add: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
notefile_idstr
note_idstr
noteNoteBody or payload of note to be added to the device

Return type

void (empty response body)

Authorization

api_key

handle_note_delete

Delete a note from a DB notefile

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    notefile_id = "notefile_id_example" # str | 
    note_id = "note_id_example" # str | 

    try:
        api_instance.handle_note_delete(project_uid, device_uid, notefile_id, note_id)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_note_delete: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
notefile_idstr
note_idstr

Return type

void (empty response body)

Authorization

api_key

handle_note_get

Get a note from a DB notefile

Example

import notehub_py
from notehub_py.models.handle_note_get200_response import HandleNoteGet200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    notefile_id = "notefile_id_example" # str | 
    note_id = "note_id_example" # str | 
    delete = True # bool | Whether to delete the note from the DB notefile (optional)
    deleted = True # bool | Whether to return deleted notes (optional)

    try:
        api_response = api_instance.handle_note_get(project_uid, device_uid, notefile_id, note_id, delete=delete, deleted=deleted)
        print("The response of DeviceApi->handle_note_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_note_get: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
notefile_idstr
note_idstr
deleteboolWhether to delete the note from the DB notefile[optional]
deletedboolWhether to return deleted notes[optional]

Return type

Successful 200 handle_note_get response

Authorization

api_key

handle_note_signal

Send a signal from Notehub to a Notecard.

Example

import notehub_py
from notehub_py.models.body import Body
from notehub_py.models.handle_note_signal200_response import HandleNoteSignal200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    body = notehub_py.Body() # Body | Body or payload of signal to be sent to the device

    try:
        api_response = api_instance.handle_note_signal(project_uid, device_uid, body)
        print("The response of DeviceApi->handle_note_signal:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_note_signal: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
bodyBodyBody or payload of signal to be sent to the device

Body Properties

NameTypeDescriptionNotes
bodyobject[optional] Example code: { "signal": "signal_example" }

Return type

Successful 200 handle_note_signal Response

Authorization

api_key

handle_note_update

Update a note in a DB notefile

Example

import notehub_py
from notehub_py.models.note import Note
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    notefile_id = "notefile_id_example" # str | 
    note_id = "note_id_example" # str | 
    note = notehub_py.Note() # Note | Body or payload of note to be added to the device

    try:
        api_instance.handle_note_update(project_uid, device_uid, notefile_id, note_id, note)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_note_update: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
notefile_idstr
note_idstr
noteNoteBody or payload of note to be added to the device

Note Properties

NameTypeDescriptionNotes
bodyobject[optional]
payloadstr[optional]

Return type

void (empty response body)

Authorization

api_key

handle_notefile_changes

Used to perform queries on a single or multiple files to determine if new Notes are available to read

Example

import notehub_py
from notehub_py.models.handle_notefile_changes200_response import HandleNotefileChanges200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    tracker = "tracker_example" # str | The change tracker ID. (optional)
    files = ["file_1", "file_2"] # List[str] | One or more files to obtain change information from. (optional)

    try:
        api_response = api_instance.handle_notefile_changes(project_uid, device_uid, tracker=tracker, files=files)
        print("The response of DeviceApi->handle_notefile_changes:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_notefile_changes: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
trackerstrThe change tracker ID.[optional]
filesList[str]One or more files to obtain change information from.[optional]

Return type

Successful 200 handle_notefile_changes response

Authorization

api_key

handle_notefile_changes_pending

Returns info about file changes that are pending upload to Notehub or download to the Notecard.

Example

import notehub_py
from notehub_py.models.handle_notefile_changes_pending200_response import HandleNotefileChangesPending200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_response = api_instance.handle_notefile_changes_pending(project_uid, device_uid)
        print("The response of DeviceApi->handle_notefile_changes_pending:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_notefile_changes_pending: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

Successful 200 handle_notefile_changes_pending response

Authorization

api_key

handle_notefile_delete

Deletes Notefiles and the Notes they contain.

Example

import notehub_py
from notehub_py.models.handle_notefile_delete_request import HandleNotefileDeleteRequest
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    files = ["file_1", "file_2", "file_3"] # List[str] |
    handle_notefile_delete_request = notehub_py.HandleNotefileDeleteRequest(files) # HandleNotefileDeleteRequest | 

    try:
        api_instance.handle_notefile_delete(project_uid, device_uid, handle_notefile_delete_request)
    except Exception as e:
        print("Exception when calling DeviceApi->handle_notefile_delete: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
handle_notefile_delete_requestHandleNotefileDeleteRequest

HandleNotefileDeleteRequest Properties

NameTypeDescriptionNotes
filesList[str]One or more files to obtain change information from.[optional] Example code: ["file_1", "file_2", "file_3"]

Return type

void (empty response body)

Authorization

api_key

post_provision_project_device

Provision Device for a Project

Example

import notehub_py
from notehub_py.models.post_provision_project_device_request import PostProvisionProjectDeviceRequest
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    project_device_props = {
        "product_uid": "com.blues.example_product_uid",
        "device_sn": "device_uid_1",
        "fleet_uids": ["fleet_uid_1"]
    }
    post_provision_project_device_request = notehub_py.PostProvisionProjectDeviceRequest(project_device_props) # PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID, device serial number, or fleetUIDs

    try:
        api_response = api_instance.post_provision_project_device(project_uid, device_uid, post_provision_project_device_request)
        print("The response of DeviceApi->post_provision_project_device:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->post_provision_project_device: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
post_provision_project_device_requestPostProvisionProjectDeviceRequestProvision a device to a specific ProductUID

PostProvisionProjectDeviceRequest Properties

NameTypeDescriptionNotes
product_uidstrThe ProductUID that the device should use.Example code: product_uid="com.blues.example_product_uid"
device_snstrThe serial number to assign to the device.[optional] Example code: device_sn="device_uid_example"
fleet_uidsList[str]The fleetUIDs to provision the device to.[optional] Example code: fleet_uids=["fleet_uid_1","fleet_uid_2"]

Return type

void (empty response body)

Authorization

api_key

put_device_environment_variables

Put environment variables of a device

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    env_vars = {"key": "value"} # Dict[str, str] | 
    environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | Environment variables to be added to the device

    try:
        api_response = api_instance.put_device_environment_variables(project_uid, device_uid, environment_variables)
        print("The response of DeviceApi->put_device_environment_variables:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->put_device_environment_variables: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
environment_variablesEnvironmentVariablesEnvironment variables to be added to the device

EnvironmentVariables Properties

NameTypeDescriptionNotes
environment_variablesDict[str, str]Example code: {"key": "value"}

Return type

Successful 200 put_device_environment_variables response

Authorization

api_key

put_device_environment_variables_by_pin

Put environment variables of a device with device pin authorization

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: pin
configuration.api_key["pin"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.DeviceApi(api_client)
    product_uid = "com.blues.bridge:sensors" # str | 
    device_uid = "device_uid_example" # str | 
        env_vars = {"key": "value"} # Dict[str, str] | 
    environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | Environment variables to be added to the device

    try:
        api_response = api_instance.put_device_environment_variables_by_pin(product_uid, device_uid, environment_variables)
        print("The response of DeviceApi->put_device_environment_variables_by_pin:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DeviceApi->put_device_environment_variables_by_pin: %s\n" % e)

Parameters

NameTypeDescriptionNotes
product_uidstr
device_uidstr
environment_variablesEnvironmentVariablesEnvironment variables to be added to the device

EnvironmentVariables Properties

NameTypeDescriptionNotes
environment_variablesDict[str, str]Example code: {"key": "value"}

Authorization

pin

Event API

MethodHTTP Request
get_fleet_eventsGET /v1/projects/{projectUID}/fleets/{fleetUID}/events
get_fleet_events_by_cursorGET /v1/projects/{projectUID}/fleets/{fleetUID}/events-cursor
get_project_eventsGET /v1/projects/{projectUID}/events
get_project_events_by_cursorGET /v1/projects/{projectUID}/events-cursor
get_route_logs_by_eventGET /v1/projects/{projectUID}/events/{eventUID}/route-logs

get_fleet_events

Get Events of a Fleet

Example

import notehub_py
from notehub_py.models.get_project_events200_response import GetProjectEvents200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.EventApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str |
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
    sort_by = "captured" # str |  (optional) (default to "captured")
    sort_order = "asc" # str |  (optional) (default to "asc")
    start_date = 1628631763 # int | Unix timestamp (optional)
    end_date = 1657894210 # int | Unix timestamp (optional)
    date_type = "captured" # str | Which date to filter on, either 'captured' or 'uploaded'.  This will apply to the startDate and endDate parameters (optional) (default to 'captured')
    system_files_only = True # bool |  (optional)
    files = "_health.qo, data.qo" # str |  (optional)
    format = "json" # str | Response format (JSON or CSV) (optional) (default to 'json')
    serial_number = ["serial_number_example"] # List[str] | Filter by Serial Number (optional)
    session_uid = ["session_uid_example"] # List[str] | Filter by Session UID (optional)
    event_uid = ["event_uid_example"] # List[str] | Filter by Event UID (optional)
    select_fields = "select_fields_example" # str | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output. (optional)

    try:
        api_response = api_instance.get_fleet_events(project_uid, fleet_uid=fleet_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, date_type=date_type, system_files_only=system_files_only, files=files, format=format, serial_number=serial_number, session_uid=session_uid, event_uid=event_uid, select_fields=select_fields)
        print("The response of EventApi->get_fleet_events:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling EventApi->get_fleet_events: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]
device_uidList[str]A Device UID.[optional]
sort_bystr[optional] [default to "captured"]
sort_orderstr[optional] [default to "asc"]
start_dateintUnix timestamp[optional]
end_dateintUnix timestamp[optional]
date_typestrWhich date to filter on, either "captured" or "uploaded". This will apply to the startDate and endDate parameters[optional] [default to "captured"]
system_files_onlybool[optional]
filesstr[optional]
formatstrResponse format ("json" or "csv")[optional] [default to "json"]
serial_numberList[str]Filter by Serial Number[optional]
session_uidList[str]Filter by Session UID[optional]
event_uidList[str]Filter by Event UID[optional]
select_fieldsstrComma-separated list of fields to include in the response (e.g., "field1,field2.subfield,field3").[optional]

Return type

Successful 200 get_fleet_events response

Authorization

api_key

get_fleet_events_by_cursor

Get Events of a Fleet by cursor

Example

import notehub_py
from notehub_py.models.get_project_events_by_cursor200_response import GetProjectEventsByCursor200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.EventApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str | 
    limit = 50 # int |  (optional) (default to 50)
    cursor = "cursor_example" # str | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.  (optional)
    sort_order = "asc" # str |  (optional) (default to "asc")
    system_files_only = True # bool |  (optional)
    files = "_health.qo, data.qo" # str |  (optional)
    device_uid = ["device_uid_example"] # str | A Device UID. (optional)
    start_date = 1628631763 # int | Unix timestamp (optional)
    end_date = 1657894210 # int | Unix timestamp (optional)

    try:
        api_response = api_instance.get_fleet_events_by_cursor(project_uid, fleet_uid, limit=limit, cursor=cursor, sort_order=sort_order, system_files_only=system_files_only, files=files, device_uid=device_uid, start_date=start_date, end_date=end_date)
        print("The response of EventApi->get_fleet_events_by_cursor:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling EventApi->get_fleet_events_by_cursor: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr
limitint[optional] [default to 50]
cursorstrA cursor, which can be obtained from the next_cursor value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.[optional]
sort_orderstr[optional] [default to "asc"]
system_files_onlybool[optional]
filesstr[optional]
device_uidList[str]A Device UID.[optional]
start_dateintUnix timestamp[optional]
end_dateintUnix timestamp[optional]

Return type

Successful 200 get_fleet_events_by_cursor response

Authorization

api_key

get_project_events

Get Events of a Project

Example

import notehub_py
from notehub_py.models.get_project_events200_response import GetProjectEvents200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.EventApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)
    device_uid = ['device_uid_example'] # List[str] | A Device UID. (optional)
    sort_by = "captured" # str |  (optional) (default to "captured")
    sort_order = "asc" # str |  (optional) (default to "asc")
    start_date = 1628631763 # int | Unix timestamp (optional)
    end_date = 1657894210 # int | Unix timestamp (optional)
    date_type = "captured" # str | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters (optional) (default to 'captured')
    system_files_only = True # bool |  (optional)
    files = "_health.qo, data.qo" # str |  (optional)
    format = "json" # str | Response format (JSON or CSV) (optional) (default to 'json')
    serial_number = ["serial_number_example"] # List[str] | Filter by Serial Number (optional)
    fleet_uid = ["fleet_uid_example"] # List[str] | Filter by Fleet UID (optional)
    session_uid = ["session_uid_example"] # List[str] | Filter by Session UID (optional)
    event_uid = ["event_uid_example"] # List[str] | Filter by Event UID (optional)
    select_fields ="select_fields_example" # str | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output. (optional)

    try:
        api_response = api_instance.get_project_events(project_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, date_type=date_type, system_files_only=system_files_only, files=files, format=format, serial_number=serial_number, fleet_uid=fleet_uid, session_uid=session_uid, event_uid=event_uid, select_fields=select_fields)
        print("The response of EventApi->get_project_events:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling EventApi->get_project_events: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]
device_uidList[str]A Device UID.[optional]
sort_bystr[optional] [default to "captured"]
sort_orderstr[optional] [default to "asc"]
start_dateintUnix timestamp[optional]
end_dateintUnix timestamp[optional]
date_typestrWhich date to filter on, either "captured" or "uploaded". This will apply to the startDate and endDate parameters[optional] [default to "captured"]
system_files_onlybool[optional]
filesstr[optional]
formatstrResponse format ("json" or "csv")[optional] [default to "json"]
serial_numberList[str]Filter by Serial Number[optional]
fleet_uidList[str]Filter by Fleet UID[optional]
session_uidList[str]Filter by Session UID[optional]
event_uidList[str]Filter by Event UID[optional]
select_fieldsstrComma-separated list of fields to include in the response (e.g., "field1,field2.subfield,field3").[optional]

Return type

Successful 200 get_project_events response

Authorization

api_key

get_project_events_by_cursor

Get Events of a Project by cursor

Example

import notehub_py
from notehub_py.models.get_project_events_by_cursor200_response import GetProjectEventsByCursor200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.EventApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    limit = 50 # int |  (optional) (default to 50)
    cursor = "cursor_example" # str | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.  (optional)
    sort_order = "asc" # str |  (optional) (default to "asc")
    system_files_only = True # bool |  (optional)
    files = "_health.qo, data.qo" # str |  (optional)
    fleet_uid = "fleet_uid_example" # str |  (optional)
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)

    try:
        api_response = api_instance.get_project_events_by_cursor(project_uid, limit=limit, cursor=cursor, sort_order=sort_order, system_files_only=system_files_only, files=files, fleet_uid=fleet_uid, device_uid=device_uid)
        print("The response of EventApi->get_project_events_by_cursor:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling EventApi->get_project_events_by_cursor: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
limitint[optional] [default to 50]
cursorstrA cursor, which can be obtained from the next_cursor value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.[optional]
sort_orderstr[optional] [default to "asc"]
system_files_onlybool[optional]
filesstr[optional]
fleet_uidstr[optional]
device_uidList[str]A Device UID.[optional]

Return type

Successful 200 get_project_events_by_cursor response

Authorization

api_key

get_route_logs_by_event

Get Route Logs by Event UID

Example

import notehub_py
from notehub_py.models.get_route_logs_by_route200_response_inner import GetRouteLogsByRoute200ResponseInner
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.EventApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    event_uid = "4506f411-dea6-44a0-9743-1130f57d7747" # str | 

    try:
        api_response = api_instance.get_route_logs_by_event(project_uid, event_uid)
        print("The response of EventApi->get_route_logs_by_event:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling EventApi->get_route_logs_by_event: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
event_uidstr

Return type

Successful 200 get_route_logs_by_event response

Authorization

api_key

Monitor API

MethodHTTP Request
create_monitorPOST /v1/projects/{projectUID}/monitors
delete_monitorDELETE /v1/projects/{projectUID}/monitors/{monitorUID}
get_monitorGET /v1/projects/{projectUID}/monitors/{monitorUID}
get_monitorsGET /v1/projects/{projectUID}/monitors
update_monitorPUT /v1/projects/{projectUID}/monitors/{monitorUID}

create_monitor

Create a new Monitor

Example

import notehub_py
from notehub_py.models.create_monitor import CreateMonitor
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.MonitorApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    monitor_props = {
        "name": "Monitor Name", # str |
        "description": "Monitor Description", # str |
        "source_type": "event", # str |
        "disabled": False, # bool |
        "alert": False, # bool |
        "notefile_filter": ["data.qo"], # List[str] |
        "source_selector": "temperature", # str |
        "condition_type": "greater_than", # str |
        "threshold": 100, # int | 
        "alert_routes": [ 
            {
             "email": "example@blues.com" # str |
            }
        ],
        "silenced": False, # bool |
        "routing_cooldown_period": "5m0s", # str |
        "per_device": False # bool |
        }
    create_monitor = notehub_py.CreateMonitor(monitor_props) # CreateMonitor | Body or payload of monitor to be created

    try:
        api_response = api_instance.create_monitor(project_uid, create_monitor)
        print("The response of MonitorApi->create_monitor:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MonitorApi->create_monitor: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
create_monitorCreateMonitorBody or payload of monitor to be created

CreateMonitor Properties

NameTypeDescriptionNotes
uidstr[optional]
namestr
descriptionstr
source_typestrThe type of source to monitor. Currently only "event" is supported.[optional]
disabledboolIf True, the monitor will not be evaluated.[optional]
alertboolIf True, the monitor is in alert state.[optional]
notefile_filterList[str]
fleet_filterList[str][optional]
source_selectorstrA valid JSONata expression that selects the value to monitor from the source. It should return a single, numeric value.[optional]
condition_typestrA comparison operation to apply to the value selected by the source_selector ["greater_than", "greater_than_or_equal_to", "less_than", "less_than_or_equal_to", "equal_to", "not_equal_to"][optional]
thresholdintThe type of condition to apply to the value selected by the source_selector[optional]
alert_routesList[MonitorAlertRoutes]
last_routed_atstrThe last time the monitor was evaluated and routed.[optional]
silencedboolIf True, alerts will be created, but no notifications will be sent.[optional]
routing_cooldown_periodstrThe time period to wait before routing another event after the monitor has been triggered. It follows the format of a number followed by a time unit.[optional] Example code: "5hr30m10s" for 5 hours, 30 minutes, 10 seconds.
aggregate_functionstrAggregate function to apply to the selected values before applying the condition. ["none", "sum", "average", "max", "min"][optional]
aggregate_windowstrThe time window to aggregate the selected values. It follows the format of a number followed by a time unit[optional] Example code: "5hr30m10s" for 5 hours, 30 minutes, 10 seconds.
per_deviceboolOnly relevant when using an aggregate_function. If True, the monitor will be evaluated per device, rather than across the set of selected devices. If True then if a single device matches the specified criteria, and alert will be created, otherwise the aggregate function will be applied across all devices.[optional]

MonitorAlertRoutes Properties

NameTypeDescriptionNotes
urlstrThe URL of the Slack webhook.[optional] Example code: { "url": "hooks.slack.com/...", "message_type": "text|blocks", "text": "Message text" }
message_typestrtext or blocks[optional]
textstrThe text of the message, or the blocks definition[optional]
tokenstrThe bearer token for the Slack app.[optional] Example code: { "token": "your_token", "channel": "CXXXXXXXX", "message_type": "text|blocks", "text": "Message text" }
channelstrThe channel to send the message to.[optional]
emailstrEmail Address[optional] Example code: { email: "your.email@blues.com" }

Return type

Successful 200 create_monitor response

Authorization

api_key

delete_monitor

Delete Monitor

Example

import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.MonitorApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    monitor_uid = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad" # str | 

    try:
        api_response = api_instance.delete_monitor(project_uid, monitor_uid)
        print("The response of MonitorApi->delete_monitor:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MonitorApi->delete_monitor: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
monitor_uidstr

Return type

Successful 200 delete_monitor response

Authorization

api_key

get_monitor

Get Monitor

Example

import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.MonitorApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    monitor_uid = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad" # str | 

    try:
        api_response = api_instance.get_monitor(project_uid, monitor_uid)
        print("The response of MonitorApi->get_monitor:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MonitorApi->get_monitor: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
monitor_uidstr

Return type

Successful 200 get_monitor response

Authorization

api_key

get_monitors

Get list of defined Monitors

Example

import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.MonitorApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_response = api_instance.get_monitors(project_uid)
        print("The response of MonitorApi->get_monitors:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MonitorApi->get_monitors: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

Successful 200 get_monitors response

Authorization

api_key

update_monitor

Update Monitor

Example

import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.MonitorApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    monitor_uid = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad" # str | 
    monitor_props = {
        "name": "Monitor Name", # str |
        "description": "Monitor Description", # str |
        "source_type": "event", # str |
        "disabled": False, # bool |
        "alert": False, # bool |
        "notefile_filter": ["data.qo"], # List[str] |
        "source_selector": "temperature", # str |
        "condition_type": "greater_than", # str |
        "threshold": 100, # int | 
        "alert_routes": [ 
            {
             "email": "example@blues.com" # str |
            }
        ],
        "silenced": False, # bool |
        "routing_cooldown_period": "5m0s", # str |
        "per_device": False # bool |
        }
    monitor = notehub_py.Monitor(monitor_props) # Monitor | Body or payload of monitor to be created

    try:
        api_response = api_instance.update_monitor(project_uid, monitor_uid, monitor)
        print("The response of MonitorApi->update_monitor:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MonitorApi->update_monitor: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
monitor_uidstr
monitorMonitorBody or payload of monitor to be created

Monitor Properties

NameTypeDescriptionNotes
uidstr[optional]
namestr
descriptionstr
source_typestrThe type of source to monitor. Currently only "event" is supported.[optional]
disabledboolIf True, the monitor will not be evaluated.[optional]
alertboolIf True, the monitor is in alert state.[optional]
notefile_filterList[str]
fleet_filterList[str][optional]
source_selectorstrA valid JSONata expression that selects the value to monitor from the source. It should return a single, numeric value.[optional]
condition_typestrA comparison operation to apply to the value selected by the source_selector ["greater_than", "greater_than_or_equal_to", "less_than", "less_than_or_equal_to", "equal_to", "not_equal_to"][optional]
thresholdintThe type of condition to apply to the value selected by the source_selector[optional]
alert_routesList[MonitorAlertRoutes]
last_routed_atstrThe last time the monitor was evaluated and routed.[optional]
silencedboolIf True, alerts will be created, but no notifications will be sent.[optional]
routing_cooldown_periodstrThe time period to wait before routing another event after the monitor has been triggered. It follows the format of a number followed by a time unit.[optional] Example code: "5hr30m10s" for 5 hours, 30 minutes, 10 seconds.
aggregate_functionstrAggregate function to apply to the selected values before applying the condition. ["none", "sum", "average", "max", "min"][optional]
aggregate_windowstrThe time window to aggregate the selected values. It follows the format of a number followed by a time unit[optional] Example code: "5hr30m10s" for 5 hours, 30 minutes, 10 seconds.
per_deviceboolOnly relevant when using an aggregate_function. If True, the monitor will be evaluated per device, rather than across the set of selected devices. If True then if a single device matches the specified criteria, and alert will be created, otherwise the aggregate function will be applied across all devices.[optional]

MonitorAlertRoutes Properties

NameTypeDescriptionNotes
urlstrThe URL of the Slack webhook.[optional] Example code: { "url": "hooks.slack.com/...", "message_type": "text|blocks", "text": "Message text" }
message_typestrtext or blocks[optional]
textstrThe text of the message, or the blocks definition[optional]
tokenstrThe bearer token for the Slack app.[optional] Example code: { "token": "your_token", "channel": "CXXXXXXXX", "message_type": "text|blocks", "text": "Message text" }
channelstrThe channel to send the message to.[optional]
emailstrEmail Address[optional] Example code: { email: "your.email@blues.com" }

Return type

Successful 200 update_monitor response

Authorization

api_key

Project API

MethodHTTP Request
clone_projectPOST /v1/projects/{projectUID}/clone
create_fleetPOST /v1/projects/{projectUID}/fleets
create_productPOST /v1/projects/{projectUID}/products
create_projectPOST /v1/projects
delete_device_fleetsDELETE /v1/projects/{projectUID}/devices/{deviceUID}/fleets
delete_fleetDELETE /v1/projects/{projectUID}/fleets/{fleetUID}
delete_fleet_environment_variableDELETE /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables/{key}
delete_projectDELETE /v1/projects/{projectUID}
delete_project_environment_variableDELETE /v1/projects/{projectUID}/environment_variables/{key}
dfu_actionPOST /v1/projects/{projectUID}/dfu/{firmwareType}/{action}
disable_global_transformationPOST /v1/projects/{projectUID}/global-transformation/disable
enable_global_transformationPOST /v1/projects/{projectUID}/global-transformation/enable
get_device_dfu_historyGET /v1/projects/{projectUID}/devices/{deviceUID}/dfu/{firmwareType}/history
get_device_dfu_statusGET /v1/projects/{projectUID}/devices/{deviceUID}/dfu/{firmwareType}/status
get_device_fleetsGET /v1/projects/{projectUID}/devices/{deviceUID}/fleets
get_devices_dfu_historyGET /v1/projects/{projectUID}/dfu/{firmwareType}/history
get_devices_dfu_statusGET /v1/projects/{projectUID}/dfu/{firmwareType}/status
get_firmware_infoGET /v1/projects/{projectUID}/firmware
get_fleetGET /v1/projects/{projectUID}/fleets/{fleetUID}
get_fleet_environment_variablesGET /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables
get_projectGET /v1/projects/{projectUID}
get_project_by_productGET /v1/products/\{productUID\}/project
get_project_environment_variablesGET /v1/projects/{projectUID}/environment_variables
get_project_fleetsGET /v1/projects/{projectUID}/fleets
get_project_membersGET /v1/projects/{projectUID}/members
get_project_productsGET /v1/projects/{projectUID}/products
get_projectsGET /v1/projects
put_device_fleetsPUT /v1/projects/{projectUID}/devices/{deviceUID}/fleets
put_fleet_environment_variablesPUT /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables
put_project_environment_variablesPUT /v1/projects/{projectUID}/environment_variables
set_global_transformationPOST /v1/projects/{projectUID}/global-transformation
update_fleetPUT /v1/projects/{projectUID}/fleets/{fleetUID}

clone_project

Clone a Project

Example

import notehub_py
from notehub_py.models.clone_project_request import CloneProjectRequest
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "project_uid_example" # str | The project UID to be cloned.
    clone_project_props = {
        "label": "label_example",
        "billing_account_uid": "billing_account_uid_example",
        "disable_clone_routes": True,
        "disable_clone_fleets": True
    }
    clone_project_request = notehub_py.CloneProjectRequest(clone_project_props) # CloneProjectRequest | Project to be cloned

    try:
        api_response = api_instance.clone_project(project_uid, clone_project_request)
        print("The response of ProjectApi->clone_project:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->clone_project: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstrThe project UID to be cloned.
clone_project_requestCloneProjectRequestProject to be cloned

CloneProjectRequest Properties

NameTypeDescriptionNotes
labelstrThe label for the project.
billing_account_uidstrThe billing account UID for the project. The caller of the API must be able to create projects within the billing account, otherwise an error will be returned.
disable_clone_routesboolWhether to disallow the cloning of the routes from the parent project. Default is False if not specified.[optional]
disable_clone_fleetsboolWhether to disallow the cloning of the fleets from the parent project. Default is False if not specified.[optional]

Return type

Successful 200 clone_project response

Authorization

api_key

create_fleet

Create Fleet

Example

import notehub_py
from notehub_py.models.create_fleet_request import CreateFleetRequest
from notehub_py.models.fleet import Fleet
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    create_fleet_request = notehub_py.CreateFleetRequest() # CreateFleetRequest | Fleet to be added

    try:
        api_response = api_instance.create_fleet(project_uid, create_fleet_request)
        print("The response of ProjectApi->create_fleet:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->create_fleet: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
create_fleet_requestCreateFleetRequestFleet to be added

CreateFleetRequest Properties

NameTypeDescriptionNotes
labelstrThe label for the Fleet.[optional]
smart_rulestrJSONata expression that will be evaluated to determine device membership into this fleet, if the expression evaluates to a 1, the device will be included, if it evaluates to -1 it will be removed, and if it evaluates to 0 or errors it will be left unchanged.[optional]

Return type

Successful 200 create_fleet response

Authorization

api_key

create_product

Create Product within a Project

Example

import notehub_py
from notehub_py.models.create_product_request import CreateProductRequest
from notehub_py.models.product import Product
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    product_request_props = {
        "product_uid": "product_uid_example",
        "label": "label_example",
        "auto_provision_fleets": [
            "fleet_id_1",
            "fleet_id_2"
        ],
        "disable_devices_by_default": True
    }
    create_product_request = notehub_py.CreateProductRequest(product_request_props) # CreateProductRequest | Product to be created

    try:
        api_response = api_instance.create_product(project_uid, create_product_request)
        print("The response of ProjectApi->create_product:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->create_product: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
create_product_requestCreateProductRequestProduct to be created

CreateProductRequest Properties

NameTypeDescriptionNotes
product_uidstrThe requested uid for the Product. Will be prefixed with the user's reversed email.
labelstrThe label for the Product.
auto_provision_fleetsList[str][optional]
disable_devices_by_defaultboolIf True, devices provisioned to this product will be automatically disabled by default.[optional]

Return type

Successful 200 create_product response

Authorization

api_key

create_project

Create a Project

Example

import notehub_py
from notehub_py.models.create_project_request import CreateProjectRequest
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_request_props = {
        "label": "label_example",
        "billing_account_uid": "billing_account_uid_example"
    }
    create_project_request = notehub_py.CreateProjectRequest() # CreateProjectRequest | Project to be created

    try:
        api_response = api_instance.create_project(create_project_request)
        print("The response of ProjectApi->create_project:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->create_project: %s\n" % e)

Parameters

NameTypeDescriptionNotes
create_project_requestCreateProjectRequestProject to be created

CreateProjectRequest Properties

NameTypeDescriptionNotes
labelstrThe label for the project.
billing_account_uidstrThe billing account UID for the project. The caller of the API must be able to create projects within the billing account, otherwise an error will be returned.

Return type

Successful 200 create_project response

Authorization

api_key

delete_device_fleets

Remove Device from Fleets

Example

import notehub_py
from notehub_py.models.delete_device_fleets_request import DeleteDeviceFleetsRequest
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    fleet_uids = [
        "fleet_uid_1",
        "fleet_uid_2"
    ]
    delete_device_fleets_request = notehub_py.DeleteDeviceFleetsRequest(fleet_uids) # DeleteDeviceFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. 

    try:
        api_response = api_instance.delete_device_fleets(project_uid, device_uid, delete_device_fleets_request)
        print("The response of ProjectApi->delete_device_fleets:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->delete_device_fleets: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
delete_device_fleets_requestDeleteDeviceFleetsRequestThe fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.

DeleteDeviceFleetsRequest Properties

NameTypeDescriptionNotes
fleet_uidsList[str]The fleetUIDs to remove from the device.

Return type

Successful 200 delete_device_fleets response

Authorization

api_key

delete_fleet

Delete Fleet

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str | 

    try:
        api_instance.delete_fleet(project_uid, fleet_uid)
    except Exception as e:
        print("Exception when calling ProjectApi->delete_fleet: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr

Return type

void (empty response body)

Authorization

api_key

delete_fleet_environment_variable

Delete environment variables of a fleet

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str | 
    key = "key_example" # str | The environment variable key to delete.

    try:
        api_response = api_instance.delete_fleet_environment_variable(project_uid, fleet_uid, key)
        print("The response of ProjectApi->delete_fleet_environment_variable:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->delete_fleet_environment_variable: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr
keystrThe environment variable key to delete.

Return type

Successful 200 delete_fleet_environment_variable response

Authorization

api_key

delete_project

Delete a Project by ProjectUID

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_instance.delete_project(project_uid)
    except Exception as e:
        print("Exception when calling ProjectApi->delete_project: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

void (empty response body)

Authorization

api_key

delete_project_environment_variable

Delete an environment variable of a project by key

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    key = "key_example" # str | The environment variable key to delete.

    try:
        api_response = api_instance.delete_project_environment_variable(project_uid, key)
        print("The response of ProjectApi->delete_project_environment_variable:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->delete_project_environment_variable: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
keystrThe environment variable key to delete.

Return type

Successful 200 delete_project_environment_variable response

Authorization

api_key

dfu_action

Update/cancel host or notecard firmware updates

Example

import notehub_py
from notehub_py.models.dfu_action_request import DfuActionRequest
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    firmware_type = "firmware_type_example" # str | 
    action = "action_example" # str | 
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
    tag = ["tag_example"] # List[str] | Tag filter (optional)
    serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
    fleet_uid = "fleet_uid_example" # str |  (optional)
    notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
    location = ["location_example"] # List[str] | Location filter (optional)
    host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
    product_uid = ["product_uid_example"] # List[str] |  (optional)
    sku = ["sku_example"] # List[str] | SKU filter (optional)
    dfu_action_request = notehub_py.DfuActionRequest() # DfuActionRequest | Which firmware in the case of an update action (optional)

    try:
        api_instance.dfu_action(project_uid, firmware_type, action, device_uid=device_uid, tag=tag, serial_number=serial_number, fleet_uid=fleet_uid, notecard_firmware=notecard_firmware, location=location, host_firmware=host_firmware, product_uid=product_uid, sku=sku, dfu_action_request=dfu_action_request)
    except Exception as e:
        print("Exception when calling ProjectApi->dfu_action: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
firmware_typestr
actionstr
device_uid[List[str]]A Device UID.[optional]
tag[List[str]]Tag filter[optional]
serial_number[List[str]]Serial number filter[optional]
fleet_uidstr[optional]
notecard_firmware[List[str]]Firmware version filter[optional]
location[List[str]]Location filter[optional]
host_firmware[List[str]]Host firmware filter[optional]
product_uid[List[str]][optional]
sku[List[str]]SKU filter[optional]
dfu_action_requestDfuActionRequestWhich firmware in the case of an update action[optional]

DfuActionRequest Properties

NameTypeDescriptionNotes
filenamestrThe name of the firmware file[optional]

Return type

void (empty response body)

Authorization

api_key

disable_global_transformation

Disable the project-level event JSONata transformation

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_instance.disable_global_transformation(project_uid)
    except Exception as e:
        print("Exception when calling ProjectApi->disable_global_transformation: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

void (empty response body)

Authorization

api_key

enable_global_transformation

Enable the project-level event JSONata transformation

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_instance.enable_global_transformation(project_uid)
    except Exception as e:
        print("Exception when calling ProjectApi->enable_global_transformation: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

void (empty response body)

Authorization

api_key

get_device_dfu_history

Get device DFU history for host or Notecard firmware

Example

import notehub_py
from notehub_py.models.device_dfu_history import DeviceDfuHistory
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "dev:000000000000000" # str | 
    firmware_type = "firmware_type_example" # str | 

    try:
        api_response = api_instance.get_device_dfu_history(project_uid, device_uid, firmware_type)
        print("The response of ProjectApi->get_device_dfu_history:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_device_dfu_history: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
firmware_typestr

Return type

Successful 200 get_device_dfu_history response

Authorization

api_key

get_device_dfu_status

Get device DFU status for host or Notecard firmware

Example

import notehub_py
from notehub_py.models.device_dfu_status import DeviceDfuStatus
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "dev:000000000000000" # str | 
    firmware_type = "firmware_type_example" # str | 

    try:
        api_response = api_instance.get_device_dfu_status(project_uid, device_uid, firmware_type)
        print("The response of ProjectApi->get_device_dfu_status:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_device_dfu_status: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
firmware_typestr

Return type

Successful 200 get_device_dfu_status response

Authorization

api_key

get_device_fleets

Get Device Fleets

Example

import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 

    try:
        api_response = api_instance.get_device_fleets(project_uid, device_uid)
        print("The response of ProjectApi->get_device_fleets:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_device_fleets: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr

Return type

Successful 200 get_device_fleets response

Authorization

api_key

get_devices_dfu_history

Get host or Notecard DFU history for all devices that match the filter criteria

Example

import notehub_py
from notehub_py.models.device_dfu_history_page import DeviceDfuHistoryPage
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    firmware_type = "firmware_type_example" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)
    sort_by = "captured" # str |  (optional) (default to "captured")
    sort_order = "asc" # str |  (optional) (default to "asc")
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
    tag = ["tag_example"] # List[str] | Tag filter (optional)
    serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
    fleet_uid = "fleet_uid_example" # str |  (optional)
    notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
    location = ["location_example"] # List[str] | Location filter (optional)
    host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
    product_uid = ["product_uid_example"] # List[str] |  (optional)
    sku = ["sku_example"] # List[str] | SKU filter (optional)

    try:
        api_response = api_instance.get_devices_dfu_history(project_uid, firmware_type, page_size=page_size, page_num=page_num, sort_by=sort_by, sort_order=sort_order, device_uid=device_uid, tag=tag, serial_number=serial_number, fleet_uid=fleet_uid, notecard_firmware=notecard_firmware, location=location, host_firmware=host_firmware, product_uid=product_uid, sku=sku)
        print("The response of ProjectApi->get_devices_dfu_history:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_devices_dfu_history: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
firmware_typestr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]
sort_bystr[optional] [default to "captured"]
sort_orderstr[optional] [default to "asc"]
device_uid[List[str]]A Device UID.[optional]
tag[List[str]]Tag filter[optional]
serial_number[List[str]]Serial number filter[optional]
fleet_uidstr[optional]
notecard_firmware[List[str]]Firmware version filter[optional]
location[List[str]]Location filter[optional]
host_firmware[List[str]]Host firmware filter[optional]
product_uid[List[str]][optional]
sku[List[str]]SKU filter[optional]

Return type

Successful 200 get_devices_dfu_history response

Authorization

api_key

get_devices_dfu_status

Get host or Notecard DFU history for all devices that match the filter criteria

Example

import notehub_py
from notehub_py.models.device_dfu_status_page import DeviceDfuStatusPage
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    firmware_type = "firmware_type_example" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)
    sort_by = "captured" # str |  (optional) (default to "captured")
    sort_order = "asc" # str |  (optional) (default to "asc")
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
    tag = ["tag_example"] # List[str] | Tag filter (optional)
    serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
    fleet_uid = "fleet_uid_example" # str |  (optional)
    notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
    location = ["location_example"] # List[str] | Location filter (optional)
    host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
    product_uid = ["product_uid_example"] # List[str] |  (optional)
    sku = ["sku_example"] # List[str] | SKU filter (optional)

    try:
        api_response = api_instance.get_devices_dfu_status(project_uid, firmware_type, page_size=page_size, page_num=page_num, sort_by=sort_by, sort_order=sort_order, device_uid=device_uid, tag=tag, serial_number=serial_number, fleet_uid=fleet_uid, notecard_firmware=notecard_firmware, location=location, host_firmware=host_firmware, product_uid=product_uid, sku=sku)
        print("The response of ProjectApi->get_devices_dfu_status:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_devices_dfu_status: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
firmware_typestr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]
sort_bystr[optional] [default to "captured"]
sort_orderstr[optional] [default to "asc"]
device_uid[List[str]]A Device UID.[optional]
tag[List[str]]Tag filter[optional]
serial_number[List[str]]Serial number filter[optional]
fleet_uidstr[optional]
notecard_firmware[List[str]]Firmware version filter[optional]
location[List[str]]Location filter[optional]
host_firmware[List[str]]Host firmware filter[optional]
product_uid[List[str]][optional]
sku[List[str]]SKU filter[optional]

Return type

Successful 200 get_devices_dfu_status response

Authorization

api_key

get_firmware_info

Get Available Firmware Information

Example

import notehub_py
from notehub_py.models.firmware_info import FirmwareInfo
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    product = "product_example" # str |  (optional)
    firmware_type = "firmware_type_example" # str |  (optional)
    version = "version_example" # str |  (optional)
    target = "target_example" # str |  (optional)
    filename = "notecard-7.2.2.16518$20240410043100.bin" # str |  (optional)
    md5 = "md5_example" # str |  (optional)
    unpublished = True # bool |  (optional)

    try:
        api_response = api_instance.get_firmware_info(project_uid, product=product, firmware_type=firmware_type, version=version, target=target, filename=filename, md5=md5, unpublished=unpublished)
        print("The response of ProjectApi->get_firmware_info:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_firmware_info: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
productstr[optional]
firmware_typestr[optional]
versionstr[optional]
targetstr[optional]
filenamestr[optional]
md5str[optional]
unpublishedbool[optional]

Authorization

api_key

get_fleet

Get Fleet

Example

import notehub_py
from notehub_py.models.fleet import Fleet
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str | 

    try:
        api_response = api_instance.get_fleet(project_uid, fleet_uid)
        print("The response of ProjectApi->get_fleet:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_fleet: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr

Return type

Successful 200 get_fleet response

Authorization

api_key

get_fleet_environment_variables

Get environment variables of a fleet

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str | 

    try:
        api_response = api_instance.get_fleet_environment_variables(project_uid, fleet_uid)
        print("The response of ProjectApi->get_fleet_environment_variables:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_fleet_environment_variables: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr

Return type

Successful 200 get_fleet_environment_variables response

Authorization

api_key

get_project

Get a Project by ProjectUID

Example

import notehub_py
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_response = api_instance.get_project(project_uid)
        print("The response of ProjectApi->get_project:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_project: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

Successful 200 get_project response

Authorization

api_key

get_project_by_product

Get a Project by ProductUID

Example

import notehub_py
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    product_uid = "com.blues.airnote" # str | 

    try:
        api_response = api_instance.get_project_by_product(product_uid)
        print("The response of ProjectApi->get_project_by_product:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_project_by_product: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

Successful 200 get_project_by_product response

Authorization

api_key

get_project_environment_variables

Get environment variables of a project

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_response = api_instance.get_project_environment_variables(project_uid)
        print("The response of ProjectApi->get_project_environment_variables:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_project_environment_variables: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

Successful 200 get_project_environment_variables response

Authorization

api_key

get_project_fleets

Get Project Fleets

Example

import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_response = api_instance.get_project_fleets(project_uid)
        print("The response of ProjectApi->get_project_fleets:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_project_fleets: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

Successful 200 get_project_fleets response

Authorization

api_key

get_project_members

Get Project Members

Example

import notehub_py
from notehub_py.models.get_project_members200_response import GetProjectMembers200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_response = api_instance.get_project_members(project_uid)
        print("The response of ProjectApi->get_project_members:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_project_members: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

Successful 200 get_project_members response

Authorization

api_key

get_project_products

Get Products within a Project

Example

import notehub_py
from notehub_py.models.get_project_products200_response import GetProjectProducts200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_response = api_instance.get_project_products(project_uid)
        print("The response of ProjectApi->get_project_products:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_project_products: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

Successful 200 get_project_products response

Authorization

api_key

get_projects

Get Projects accessible by the api_key

Example

import notehub_py
from notehub_py.models.get_projects200_response import GetProjects200Response
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)

    try:
        api_response = api_instance.get_projects()
        print("The response of ProjectApi->get_projects:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->get_projects: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

Successful 200 get_projects response

Authorization

api_key

put_device_fleets

Add Device to Fleets

Example

import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.models.put_device_fleets_request import PutDeviceFleetsRequest
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    device_uid = "device_uid_example" # str | 
    fleet_uids = ["fleet_uid_1", "fleet_uid_2"] # List[str] | An array of Fleet UIDs.
    put_device_fleets_request = notehub_py.PutDeviceFleetsRequest(fleet_uids) # PutDeviceFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. 

    try:
        api_response = api_instance.put_device_fleets(project_uid, device_uid, put_device_fleets_request)
        print("The response of ProjectApi->put_device_fleets:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->put_device_fleets: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
device_uidstr
put_device_fleets_requestPutDeviceFleetsRequestThe fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.

PutDeviceFleetsRequest Properties

NameTypeDescriptionNotes
fleet_uidsList[str]The fleetUIDs to remove from the device.

Return type

Successful 200 put_device_fleets response

Authorization

api_key

put_fleet_environment_variables

Put environment variables of a fleet

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str | 
    env_vars = {"key_1": "value_1", "key_2": "value_2"} # Dict[str, str] | 
    environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | Environment variables to be added to the fleet

    try:
        api_response = api_instance.put_fleet_environment_variables(project_uid, fleet_uid, environment_variables)
        print("The response of ProjectApi->put_fleet_environment_variables:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->put_fleet_environment_variables: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr
environment_variablesEnvironmentVariablesEnvironment variables to be added to the fleet

EnvironmentVariables Properties

NameTypeDescriptionNotes
environment_variablesDict[str, str]

Return type

Successful 200 put_fleet_environment_variables response

Authorization

api_key

put_project_environment_variables

Put environment variables of a project

Example

import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    env_vars = {"key_1": "value_1", "key_2": "value_2"} # Dict[str, str] | 
    environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables |  (optional)

    try:
        api_response = api_instance.put_project_environment_variables(project_uid, environment_variables=environment_variables)
        print("The response of ProjectApi->put_project_environment_variables:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->put_project_environment_variables: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
environment_variablesEnvironmentVariablesEnvironment variables to be added to the fleet

EnvironmentVariables Properties

NameTypeDescriptionNotes
environment_variablesDict[str, str]

Return type

Successful 200 put_project_environment_variables response

Authorization

api_key

set_global_transformation

Set the project-level event JSONata transformation

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    body = None # object | JSONata expression which will be applied to each event before it is persisted and routed

    try:
        api_instance.set_global_transformation(project_uid, body)
    except Exception as e:
        print("Exception when calling ProjectApi->set_global_transformation: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
bodyobjectJSONata expression which will be applied to each event before it is persisted and routed

Return type

void (empty response body)

Authorization

api_key

update_fleet

Update Fleet

Example

import notehub_py
from notehub_py.models.fleet import Fleet
from notehub_py.models.update_fleet_request import UpdateFleetRequest
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.ProjectApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    fleet_uid = "fleet_uid_example" # str | 
    fleet_request_properties = {
        "label": "fleet_label_1",
        "add_devices": ["device_uid_1", "device_uid_2"],
        "remove_devices": ["device_uid_3", "device_uid_4"]
    }
    update_fleet_request = notehub_py.UpdateFleetRequest(fleet_request_properties) # UpdateFleetRequest | Fleet details to update

    try:
        api_response = api_instance.update_fleet(project_uid, fleet_uid, update_fleet_request)
        print("The response of ProjectApi->update_fleet:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectApi->update_fleet: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
fleet_uidstr
update_fleet_requestUpdateFleetRequestFleet details to update

UpdateFleetRequest Properties

NameTypeDescriptionNotes
labelstrThe label for the Fleet.[optional] Code example:* { "label": "Fleet Label", "add_devices": ["device_id_1", "device_id_2"], "remove_devices": ["device_id_3", "device_id_4"] }
add_devicesList[str]List of DeviceUIDs to add to fleet[optional]
remove_devicesList[str]List of DeviceUIDs to remove from fleet[optional]
smart_rulestrJSONata expression that will be evaluated to determine device membership into this fleet, if the expression evaluates to a 1, the device will be included, if it evaluates to -1 it will be removed, and if it evaluates to 0 or errors it will be left unchanged.[optional]

Return type

Successful 200 update_fleet response

Authorization

api_key

Route API

MethodHTTP Request
create_routePOST /v1/projects/{projectUID}/routes
delete_routeDELETE /v1/projects/{projectUID}/routes/{routeUID}
get_routeGET /v1/projects/{projectUID}/routes/{routeUID}
get_route_logs_by_routeGET /v1/projects/{projectUID}/routes/{routeUID}/route-logs
get_routesGET /v1/projects/{projectUID}/routes
update_routePUT /v1/projects/{projectUID}/routes/{routeUID}

create_route

Create Route within a Project

Example

import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    notehub_route = {
        "label": "Route Label",
        "type":"http",
        "http": {
            "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
            "throttle_ms": 100,
            "url": "http://route.url"
        }
    }
    # NotehubRoute | Route to be Created
    try:
        api_response = api_instance.create_route(project_uid, notehub_route)
        print("The response of RouteApi->create_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->create_route: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
notehub_routeNotehubRouteRoute to be Created

NotehubRoute Properties

NameTypeDescriptionNotes
uidstrRoute UID[optional]
labelstrRoute Label[optional]
route_typestrType of route.[optional] [default to "http"]
modifiedstrLast Modified[optional]
disabledboolIs route disabled?[optional] [default to False]
var_schemaNotehubRouteSchema[optional]

NotehubRouteSchema Properties

NameTypeDescriptionNotes
fleetsList[str]list of Fleet UIDs to apply route to, if any. If empty, applies to all Fleets[optional]
filterHttpFilter[optional]
transformSnowflakeTransform[optional]
throttle_msintMinimum time between requests in Miliseconds[optional]
urlstr[optional]
http_headersDict[str, str][optional]
disable_http_headersbool[optional] [default to False]
timeoutintTimeout in seconds for each request[optional] [default to 15]
tokenstrOptional authentication token[optional]
aliasstr[optional]
brokerstr[optional]
portint[optional]
usernamestr[optional]
passwordstrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
topicstr[optional]
certificatestrCertificate with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder[optional]
certificate_namestrName of certificate.[optional]
keystrKey with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder[optional]
private_key_namestrName of PEM key. If omitted, defaults to "present"[optional] [default to 'present']
regionstr[optional]
access_key_idstr[optional]
access_key_secretstrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
message_group_idstr[optional]
message_deduplication_idstr[optional]
channelstrThe Channel ID for Bearer Token method, if the "slack-bearer" type is selected[optional]
test_apibool[optional] [default to False]
data_feed_keystr[optional]
client_idstr[optional]
client_secretstrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
functions_key_secretstrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
sas_policy_namestr[optional]
sas_policy_keystrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
app_keystrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
organization_namestr[optional]
account_namestr[optional]
user_namestr[optional]
pemstrPEM key with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder[optional]
slack_typestrThe type of Slack message. Must be one of "slack-bearer for Bearer Token or "slack-webhook" for Webhook messages[optional]
bearerstrThe Bearer Token for Slack messaging, if the "slack-bearer" type is selected[optional]
webhook_urlstrThe Webhook URL for Slack Messaging if the "slack-webhook" type is selected[optional]
textstrThe simple text message to be sent, if the blocks message field is not in use. Placeholders are available for this field.[optional]
blocksstrThe Blocks message to be sent. If populated, this field overrides the text field within the Slack Messaging API. Placeholders are available for this field.[optional]

HTTPFilter Properties

NameTypeDescriptionNotes
typestrWhat notefiles this route applies to.[optional]
system_notefilesboolWhether system notefiles should be affected by this route[optional]
filesList[str][optional]

SnowflakeTransform Properties

NameTypeDescriptionNotes
formatstrData transformation to apply. Only "jsonata" is valid for Snowflake routes[optional] [default to "jsonata"]
jsonatastrJSONata transformation[optional]

Return type

Successful 200 create_route response

Authorization

api_key

delete_route

Delete single route within a project

Example

import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str | 

    try:
        api_response = api_instance.delete_route(project_uid, route_uid)
        print("The response of RouteApi->delete_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->delete_route: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
route_uidstr

Return type

Successful 200 delete_route response

Authorization

api_key

get_route

Get single route within a project

Example

import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str | 

    try:
        api_response = api_instance.get_route(project_uid, route_uid)
        print("The response of RouteApi->get_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->get_route: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
route_uidstr

Return type

Successful 200 get_route response

Authorization

api_key

get_route_logs_by_route

Get Route Logs by Route UID

Example

import notehub_py
from notehub_py.models.get_route_logs_by_route200_response_inner import GetRouteLogsByRoute200ResponseInner
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str | 
    page_size = 50 # int |  (optional) (default to 50)
    page_num = 1 # int |  (optional) (default to 1)
    device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
    sort_by = "captured" # str |  (optional) (default to "captured")
    sort_order = "asc" # str |  (optional) (default to "asc")
    start_date = 1628631763 # int | Unix timestamp (optional)
    end_date = 1657894210 # int | Unix timestamp (optional)
    system_files_only = True # bool |  (optional)
    files = "_health.qo, data.qo" # str |  (optional)

    try:
        api_response = api_instance.get_route_logs_by_route(project_uid, route_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, system_files_only=system_files_only, files=files)
        print("The response of RouteApi->get_route_logs_by_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->get_route_logs_by_route: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
route_uidstr
page_sizeint[optional] [default to 50]
page_numint[optional] [default to 1]
device_uidList[str]A Device UID.[optional]
sort_bystr[optional] [default to "captured"]
sort_orderstr[optional] [default to "asc"]
start_dateintUnix timestamp[optional]
end_dateintUnix timestamp[optional]
system_files_onlybool[optional]
filesstr[optional]

Return type

Successful 200 get_route_logs_by_route response

Authorization

api_key

get_routes

Get all Routes within a Project

Example

import notehub_py
from notehub_py.models.user_db_route import UserDbRoute
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 

    try:
        api_response = api_instance.get_routes(project_uid)
        print("The response of RouteApi->get_routes:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->get_routes: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr

Return type

Successful 200 get_routes response

Authorization

api_key

update_route

Update route by UID

Example

import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
    host = "https://api.notefile.net"
)

# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = notehub_py.RouteApi(api_client)
    project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str | 
    route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str | 
    notehub_route = {
        "http" {
            "filter": {
            "type": "include",
            "system_notefiles": true,
            "files": ["somefile.qo"],
            },
            "throttle_ms": 50,
            "url": "http://new-route.url",
        },
    }
    # NotehubRoute | Route settings to be updated
    try:
        api_response = api_instance.update_route(project_uid, route_uid, notehub_route)
        print("The response of RouteApi->update_route:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RouteApi->update_route: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_uidstr
route_uidstr
notehub_routeRouteRoute settings to be updated

NotehubRoute Properties

NameTypeDescriptionNotes
uidstrRoute UID[optional]
labelstrRoute Label[optional]
route_typestrType of route.[optional] [default to 'http']
modifiedstrLast Modified[optional]
disabledboolIs route disabled?[optional] [default to False]
var_schemaNotehubRouteSchema[optional]

NotehubRouteSchema Properties

NameTypeDescriptionNotes
fleetsList[str]list of Fleet UIDs to apply route to, if any. If empty, applies to all Fleets[optional]
filterHttpFilter[optional]
transformSnowflakeTransform[optional]
throttle_msintMinimum time between requests in Miliseconds[optional]
urlstr[optional]
http_headersDict[str, str][optional]
disable_http_headersbool[optional] [default to False]
timeoutintTimeout in seconds for each request[optional] [default to 15]
tokenstrOptional authentication token[optional]
aliasstr[optional]
brokerstr[optional]
portint[optional]
usernamestr[optional]
passwordstrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
topicstr[optional]
certificatestrCertificate with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder[optional]
certificate_namestrName of certificate.[optional]
keystrKey with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder[optional]
private_key_namestrName of PEM key. If omitted, defaults to "present"[optional] [default to 'present']
regionstr[optional]
access_key_idstr[optional]
access_key_secretstrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
message_group_idstr[optional]
message_deduplication_idstr[optional]
channelstrThe Channel ID for Bearer Token method, if the "slack-bearer" type is selected[optional]
test_apibool[optional] [default to False]
data_feed_keystr[optional]
client_idstr[optional]
client_secretstrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
functions_key_secretstrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
sas_policy_namestr[optional]
sas_policy_keystrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
app_keystrThis value is input-only and will be omitted from the response and replaced with a placeholder[optional]
organization_namestr[optional]
account_namestr[optional]
user_namestr[optional]
pemstrPEM key with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder[optional]
slack_typestrThe type of Slack message. Must be one of "slack-bearer for Bearer Token or "slack-webhook" for Webhook messages[optional]
bearerstrThe Bearer Token for Slack messaging, if the "slack-bearer" type is selected[optional]
webhook_urlstrThe Webhook URL for Slack Messaging if the "slack-webhook" type is selected[optional]
textstrThe simple text message to be sent, if the blocks message field is not in use. Placeholders are available for this field.[optional]
blocksstrThe Blocks message to be sent. If populated, this field overrides the text field within the Slack Messaging API. Placeholders are available for this field.[optional]

HTTPFilter Properties

NameTypeDescriptionNotes
typestrWhat notefiles this route applies to.[optional]
system_notefilesboolWhether system notefiles should be affected by this route[optional]
filesList[str][optional]

SnowflakeTransform Properties

NameTypeDescriptionNotes
formatstrData transformation to apply. Only "jsonata" is valid for Snowflake routes[optional] [default to "jsonata"]
jsonatastrJSONata transformation[optional]

Return type

Successful 200 update_route response

Authorization

api_key

Can we improve this page? Send us feedback
© 2025 Blues Inc.
© 2025 Blues Inc.
TermsPrivacy
Notecard Disconnected
Having trouble connecting?

Try changing your USB cable as some cables do not support transferring data. If that does not solve your problem, contact us at support@blues.com and we will get you set up with another tool to communicate with the Notecard.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up