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
API Reference
Glossary
System Notefiles
Notecard API
Introduction
card Requests
dfu Requests
env Requests
file Requests
hub Requests
note Requests
ntn Requests
var Requests
web Requests
Notehub API
API Introduction
Authorization API
Billing Account API
Device API
Get Project DevicesGet DeviceDelete DeviceDisable DeviceEnable DeviceDisable Connectivity AssuranceEnable Connectivity AssuranceDelete Device Environment VariableGet Device Environment VariablesSet Device Environment VariablesGet Device Health LogGet Device Latest EventsGet Device SessionsGet Fleet DevicesGet NoteGet Note ChangesAdd NoteUpdate NoteDelete NoteSend SignalGet Notefile ChangesGet Pending Notefile ChangesDelete NotefileProvision DeviceGet Device Public KeyGet Public Keys
Event API
Monitor API
Project API
Route API
homechevron_rightDocschevron_rightAPI Referencechevron_rightNotehub APIchevron_rightDevice API - Notehub API Reference

Device API

The Notehub device API provides RESTful methods that can be used to GET, POST, and DELETE data related to devices and fleets.

NameHTTP Request
Get Project DevicesGET /v1/projects/{projectUID}/devices
Get DeviceGET /v1/projects/{projectUID}/devices/{deviceUID}
Delete DeviceDELETE /v1/projects/{projectUID}/devices/{deviceUID}
Disable DevicePOST /v1/projects/{projectUID}/devices/{deviceUID}/disable
Enable DevicePOST /v1/projects/{projectUID}/devices/{deviceUID}/enable
Disable Connectivity AssurancePOST /v1/projects/{projectUID}/devices/{deviceUID}/disable-connectivity-assurance
Enable Connectivity AssurancePOST /v1/projects/{projectUID}/devices/{deviceUID}/enable-connectivity-assurance
Delete Device Environment VariableDELETE /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables/{key}
Get Device Environment VariablesGET /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables
Set Device Environment VariablesPUT /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables
Get Device Health LogGET /v1/projects/{projectUID}/devices/{deviceUID}/health-log
Get Device Latest EventsGET /v1/projects/{projectUID}/devices/{deviceUID}/latest
Get Device SessionsGET /v1/projects/{projectUID}/devices/{deviceUID}/sessions
Get Fleet DevicesGET /v1/projects/{projectUID}/fleets/{fleetUID}/devices
Get NoteGET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
Get Note ChangesGET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/changes
Add NotePOST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}
Update NotePUT /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
Delete NoteDELETE /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
Send SignalPOST /v1/projects/{projectUID}/devices/{deviceUID}/signal
Get Notefile ChangesGET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes
Get Pending Notefile ChangesGET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes/pending
Delete NotefileDELETE /v1/projects/{projectUID}/devices/{deviceUID}/files
Provision DevicePOST /v1/projects/{projectUID}/devices/{deviceUID}/provision
Get Device Public KeyGET /v1/projects/{projectUID}/devices/{deviceUID}/public-key
Get Public KeysGET /v1/projects/{projectUID}/devices/public-keys

Get Project Devices Notehub

Get an array of devices associated with a Notehub project.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

pageSize

integer (optional)

Specifies the number of devices to be returned by a request (default 50).

pageNum

integer (optional)

Specifies the page number of the results returned (useful when the pageSize is less than the total number of devices that could be returned). When provided, the pageNum must be >= 1.

deviceUID

Array (optional)

An array of DeviceUIDs of Notehub devices.

tag

Array (optional)

An array of one or more tags to filter the devices by.

serialNumber

Array (optional)

An array of device serial numbers to filter by.

fleetUID

Array (optional)

An array of FleetUIDs to filter by.

notecardFirmware

Array (optional)

An array of one or more Notecard firmware versions to filter the devices by. Any numeric portion of the firmware name like "7.4.2.16888" or "7.4" is acceptable.

location

Array (optional)

An array of one or more locations to filter the devices by. Provide city, state, or country code like "Boston, MA", "Boston", "MA", or "Guildford, ENG, GB" (this field supports partial/case insensitive matches).

hostFirmware

Array (optional)

An array of one or more host firmware versions to filter the devices by. Any string of host firmware like "foo-3.4" or "8.7.6" or "baz-bar-01" is acceptable.

productUID

Array (optional)

An array of one or more ProductUIDs to filter the devices by.

sku

Array (optional)

An array of one or more Notecard SKUs to filter the devices by.

curl -X GET
   -L 'https://api.notefile.net/v1/projects/<projectUID>/devices'
   -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  deviceUID: ["null"], // [String] | A Device UID.
  tag: ["null"], // [String] | Tag filter
  serialNumber: ["null"], // [String] | Serial number filter
  fleetUID: ["null"], // [String] |
  notecardFirmware: ["null"], // [String] | Firmware version filter
  location: ["null"], // [String] | Location filter
  hostFirmware: ["null"], // [String] | Host firmware filter
  productUID: ["null"], // [String] |
  sku: ["null"] // [String] | SKU filter
};
apiInstance.getProjectDevices(projectUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
curl -X GET
   -L 'https://api.notefile.net/v1/projects/<projectUID>/devices?pageSize=<pageSize>&pageNum=<pageNum>&deviceUID=<deviceUID>&tag=<tag>&serialNumber=<serialNumber>&fleetUID=<fleetUID>&notecardFirmware=<notecardFirmware>&location=<location>&hostFirmware=<hostFirmware>&productUID=<productUID>&sku=<sku>'
   -H 'Authorization: Bearer <access_token>'
Response Members

uid

string

The globally-unique identifier of the device.

serial_number

string

The user-defined serial number of the device.

provisioned

string

The date and time this device was first provisioned, or put into use.

last_activity

string

The date and time this device was last seen by Notehub.

contact

object

Contact information for this device, specified via environment variables.

product_uid

string

The ProductUID this device is associated with.

fleet_uids

array

An array of globally-unique identifiers for the fleet(s) this device is associated with.

tower_info

object

An object containing data about the cellular tower last accessed by this device.

tower_info.mcc

integer

The mobile country code of the cell tower.

tower_info.mnc

integer

The mobile network code of the cell tower, which identifies the mobile operator.

tower_info.lac

integer

The location area code of the cell tower, which is a unique identifier of the current location area.

tower_info.cell_id

integer

The Cell ID or CID of the cell tower. This is a unique number used to identify each Base Transceiver Station (BTS) or sector of a BTS within a location area code.

tower_location

object

An object containing information about the physical location of the cell tower.

gps_location

object

An object containing information about the physical location of the device, based on GPS coordinates.

triangulated_location

object

An object containing information about the physical location of the device based on triangulated data calculated by multiple cell towers.

voltage

decimal

The most recent measure of the voltage from the onboard voltage monitor.

temperature

decimal

The most recent temperature measure in celsius from the onboard temperature sensor.

has_more

boolean

Defines whether or not there are additional devices beyond this list.

dfu

object

Information about the device firmware update status for the Notecard "type":"card" or the host MCU "type":"user". The mode will be one of:

"idle" - nothing downloading or downloaded
"error" - halted and in the error state
"downloading" - transferring data from cloud to module
"sideloading" - transferring data via request to module
"ready" - DFU data is ready/verified and waiting on external storage
"ready-retry" - DFU data is ready/verified and retrying
"updating" - currently updating
"completed" - DFU is done successfully

sku

string

The SKU of the Notecard in use. See the Notecard datasheet dropdown menu for example SKUs.

firmware_notecard

string

The firmware version of the Notecard in use.

firmware_host

string

The firmware version of the host MCU in use (if any).

disabled

boolean

Whether or not the device is disabled.

Example Response
{
   "devices":[
      {
         "uid":"dev:000000000000000",
         "serial_number":"",
         "sku": "NOTE-NBGL",
         "provisioned":"2021-02-11T02:37:16Z",
         "last_activity":"2021-05-11T19:37:08Z",
         "firmware_notecard": "{\"org\":\"Blues Wireless\",\"product\":\"Notecard\",\"version\":\"notecard-1.2.3-v11\",\"ver_major\":1,\"ver_minor\":2,\"ver_patch\":3,\"ver_build\":9380,\"built\":\"Apr 16 2020 16:22:56\"}",
         "firmware_host": "{\"org\":\"\",\"product\":\"Product\",\"description\":\"\",\"firmware\":\"airnote-v1\",\"version\":\"1.1.1\",\"built\":\"Dec  7 2019 21:53:07\",\"ver_ma",
         "contact":null,
         "product_uid":"product:com.your-company.your-name:project",
         "fleet_uids":"[fleet:00000000-0000-0000-0000-000000000000]",
         "tower_info":{
            "mcc":310,
            "mnc":410,
            "lac":12345,
            "cell_id":12345678
         },
         "tower_location":{
            "when":"2021-05-11T19:34:23Z",
            "name":"Cassville MO",
            "country":"US",
            "timezone":"America/Chicago",
            "latitude":36.665537500000006,
            "longitude":-93.850109375
         },
         "gps_location":{
            "same properties as tower_location"
         },
         "triangulated_location":{
            "same properties as tower_location"
         },
         "voltage":5.15,
         "temperature":23.75,
         "dfu":{
            "card":{
               "type":"card",
               "mode":"idle",
               "updated":1632938485,
               "version":"{\"org\":\"Blues Wireless\",\"product\":\"Notecard\",\"version\":\"notecard-1.5.6\",\"ver_major\":1,\"ver_minor\":5,\"ver_patch\":6,\"ver_build\":13695,\"built\":\"Sep 13 2021 15:37:30\"}"
            },
            "user":{
               "type":"user",
               "mode":"idle",
               "updated":1632938486
            }
         },
         "sku":"NOTE-WBNA-500"
      }
   ],
   "has_more":false
}

Get Device Notehub

Get information about a single device by its DeviceUID.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDevice(projectUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

uid

string

The globally-unique identifier of the device.

serial_number

string

The user-defined serial number of the device.

provisioned

string

The date and time this device was first provisioned, or put into use.

last_activity

string

The date and time this device was last seen by Notehub.

contact

object

Contact information for this device, specified via environment variables.

product_uid

string

The ProductUID this device is associated with.

fleet_uids

array

An array of globally-unique identifiers for the fleet(s) this device is associated with.

tower_info

object

An object containing data about the cellular tower last accessed by this device.

tower_info.mcc

integer

The mobile country code of the cell tower.

tower_info.mnc

integer

The mobile network code of the cell tower, which identifies the mobile operator.

tower_info.lac

integer

The location area code of the cell tower, which is a unique identifier of the current location area.

tower_info.cell_id

integer

The Cell ID or CID of the cell tower. This is a unique number used to identify each Base Transceiver Station (BTS) or sector of a BTS within a location area code.

tower_location

object

An object containing information about the physical location of the cell tower.

gps_location

object

An object containing information about the physical location of the device, based on GPS coordinates.

triangulated_location

object

An object containing information about the physical location of the device, based on triangulated data calculated by multiple cell towers.

voltage

decimal

The most recent measure of the voltage from the onboard voltage monitor.

temperature

decimal

The most recent temperature measure in celsius from the onboard temperature sensor.

dfu

object

Information about the device firmware update status for the Notecard "type":"card" or the host MCU "type":"user". The mode will be one of:

"idle" - nothing downloading or downloaded
"error" - halted and in the error state
"downloading" - transferring data from cloud to module
"sideloading" - transferring data via request to module
"ready" - DFU data is ready/verified and waiting on external storage
"ready-retry" - DFU data is ready/verified and retrying
"updating" - currently updating
"completed" - DFU is done successfully

sku

string

The SKU of the Notecard in use. See the Notecard datasheet dropdown menu for example SKUs.

firmware_notecard

string

The firmware version of the Notecard in use.

firmware_host

string

The firmware version of the host MCU in use (if any).

disabled

boolean

Whether or not the device is disabled.

Example Response
{
    "uid":"dev:000000000000000",
    "serial_number":"",
    "sku": "NOTE-NBGL",
    "provisioned":"2021-02-11T02:37:16Z",
    "last_activity":"2021-05-11T19:37:08Z",
    "firmware_notecard": "{\"org\":\"Blues Wireless\",\"product\":\"Notecard\",\"version\":\"notecard-4.4.1\",\"ver_major\":4,\"ver_minor\":4,\"ver_patch\":1,\"ver_build\":4015700,\"built\":\"May  5 2023 12:20:37\"}",
    "firmware_host": "{\"org\":\"\",\"product\":\"Product\",\"description\":\"\",\"firmware\":\"airnote-v1\",\"version\":\"1.1.1\",\"built\":\"Dec  7 2019 21:53:07\",\"ver_ma",
    "contact":null,
    "product_uid":"product:com.your-company.your-name:project",
    "fleet_uids":["fleet:00000000-0000-0000-0000-000000000000"],
    "tower_info":{
      "mcc":310,
      "mnc":410,
      "lac":12345,
      "cell_id":12345678
    },
    "tower_location":{
      "when":"2021-05-11T19:34:23Z",
      "name":"Cassville MO",
      "country":"US",
      "timezone":"America/Chicago",
      "latitude":36.665537500000006,
      "longitude":-93.850109375
    },
    "gps_location":{
      "same properties as tower_location"
    },
    "triangulated_location":{
      "same properties as tower_location"
    },
    "voltage":5.15,
    "temperature":23.75,
    "dfu":{
      "card":{
          "type":"card",
          "mode":"idle",
          "updated":1632938485,
          "version":"{\"org\":\"Blues Wireless\",\"product\":\"Notecard\",\"version\":\"notecard-1.5.6\",\"ver_major\":1,\"ver_minor\":5,\"ver_patch\":6,\"ver_build\":13695,\"built\":\"Sep 13 2021 15:37:30\"}"
      },
      "user":{
          "type":"user",
          "mode":"idle",
          "updated":1632938486
      }
    },
    "sku":"NOTE-WBNA-500"
}

Delete Device Notehub

Delete a single device by its DeviceUID.

HTTP Method:DELETE
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

purge

boolean

true performs an additional level of deletion that also removes associated files and sessions from Notehub.

false will perform a shallow delete that only removes the device, but other data will persist.

curl -X DELETE
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>?purge=<purge>'
     -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let purge = "false"; // String |
apiInstance.deleteProjectDevice(projectUID, deviceUID, purge).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
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" # str |  (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)

Disable Device Notehub

Disable a device by its DeviceUID.

HTTP Method:POST
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/disable
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X POST
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/disable'
     -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.disableDevice(projectUID, deviceUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
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)

Enable Device Notehub

Enable a disabled device by its DeviceUID.

HTTP Method:POST
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/enable
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X POST
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/enable'
     -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.enableDevice(projectUID, deviceUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
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)

Disable Connectivity Assurance Notehub

Disable Connectivity Assurance on a device by its DeviceUID.

HTTP Method:POST
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/disable-connectivity-assurance
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X POST
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/disable-connectivity-assurance'
     -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.disableDeviceConnectivityAssurance(projectUID, deviceUID).then(() => {
  console.log("API called successfully.");
}, (error) => {
  console.error(error);
});
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)

Enable Connectivity Assurance Notehub

Enable Connectivity Assurance on a device by its DeviceUID.

HTTP Method:POST
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/enable-connectivity-assurance
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X POST
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/enable-connectivity-assurance'
     -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.enableDeviceConnectivityAssurance(projectUID, deviceUID).then(() => {
  console.log("API called successfully.");
}, (error) => {
  console.error(error);
});
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)

Delete Device Environment Variable Notehub

Delete an environment variable by ProjectUID, DeviceUID, and environment variable key.

HTTP Method:DELETE
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/environment_variables/{key}
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
  • key - The key of the environment variable.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X DELETE
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/environment_variables/<key>'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance.deleteDeviceEnvironmentVariable(projectUID, deviceUID, key).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

environment_variables

object

JSON object containing environment variables in "key":"value" format.

Example Response
{
  "environment_variables": {
    "_tags": "",
    "device_humidity": "55.9",
    "device_temp": "79.0"
  }
}

Get Device Environment Variables Notehub

Get all device-level environment variables by ProjectUID and DeviceUID.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/environment_variables
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/environment_variables'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceEnvironmentVariables(projectUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

environment_variables

object

JSON object containing device-level environment variables in "key":"value" format.

environment_variables_env_default

object

JSON object containing any default environment variables in "key":"value" format.

Example Response
{
  "environment_variables": {
    "_tags": "",
    "device_humidity": "55.9",
    "device_temp": "79.0"
  },
  "environment_variables_env_default": {}
}

Set Device Environment Variables Notehub

Set device-level environment variables by ProjectUID and DeviceUID.

HTTP Method:PUT
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/environment_variables
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

environment_variables

object

A JSON object containing the key-value pair(s) of environment variable(s) to be added. For example: {"key1":"value1","key2":"value2"}.

curl -X PUT
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/environment_variables'
    -H 'Authorization: Bearer <access_token>'
    -d '{"environment_variables":<environment_variables>}'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let envVars = {key1: "value1", key2: "value2"} // {String: String} |
let environmentVariables = new NotehubJs.EnvironmentVariables(envVars); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
  .putDeviceEnvironmentVariables(projectUID, deviceUID, environmentVariables)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
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)
Response Members

environment_variables

object

JSON object containing environment variables in "key":"value" format.

Example Response
{
  "environment_variables": {
    "_tags": "",
    "device_humidity": "55.9",
    "device_temp": "79.0"
  }
}

Get Device Health Log Notehub

Get an array of health log events by ProjectUID and DeviceUID.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/health-log
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/health-log'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceHealthLog(projectUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

when

string

The date and time this event was received by Notehub.

alert

boolean

The date and time this event was received by Notehub.

text

string

Descriptive information about the health log event.

Example Response
{
  "health_log": [
    {
      "when": "2021-04-27T15:37:47Z",
      "alert": false,
      "text": "boot (brown-out \u0026 hard reset [12460])"
    }
  ]
}

Get Device Latest Events Notehub

Get the most recent health log, session, and events by ProjectUID and DeviceUID (updated at the end of every session). If a device is in continuous mode, the latest events are updated every 15 minutes.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/latest
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
note

This API reference displays all possible fields that can be present in an event response. However, certain fields will only be present for certain types of events (e.g. Note added event, Note updated event, .dbs update event, Notehub session event, etc).

Arguments
None
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/latest'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceLatest(projectUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

latest_events

array

An array of the latest events captured by the device (see the Get Project Events response for a full description of the data elements returned).

Example Response
{
  "latest_events": [
    {
      "event": "916d4c81-06ae-4263-9b55-7a3a0f73cb5a",
      "platform": true,
      "when": 1643991794,
      "file": "_session_.qo",
      "body": {
        "opened": true,
        "why": "periodic inbound sync due, periodic outbound sync due"
      },
      "session": "28cdc39f-9f62-4789-b0a3-2f35f9448ced",
      "transport": "hub",
      "best_id": "tj-1",
      "device": "dev:864475040523995",
      "sn": "tj-1",
      "product": "product:com.blues.app:myapp",
      "app": "app:3733f429-9335-6756-3456-c397c0000000",
      "received": 1643991803.316966,
      "req": "session.begin",
      "best_location_type": "tower",
      "best_location_when": 1643991727,
      "best_lat": 43.769062500000004,
      "best_lon": -83.657359375,
      "best_location": "Waverly MI",
      "best_country": "US",
      "best_timezone": "America/Detroit",
      "tower_when": 1643991727,
      "tower_lat": 43.769062500000004,
      "tower_lon": -83.657359375,
      "tower_country": "US",
      "tower_location": "Waverly MI",
      "tower_timezone": "America/Detroit",
      "tower_id": "310,410,20483,184692495",
      "fleets": [
        "fleet:f9045782-6ad1-483c-a4d2-ab859f4adc04"
      ],
      "bearer": "unknown",
      "cellid": "310,410,11298,187681040",
      "rssi": -66,
      "sinr": 12,
      "rsrp": -88,
      "rsrq": -12,
      "rat": "emtc",
      "bars": 3,
      "voltage": 3.478,
      "temp": 5.187,
      "moved": 1739702187,
      "orientation": "landscape-right"
    },
    {
      "event": "e98c2c3b-edbe-4fe7-af57-2196cc843eb7",
      "session": "7211392c-6895-43f8-9256-790655348be5",
      "device": "dev:864475040523995",
      "product": "product:com.blues.app:myapp",
      "received": 1663343137.75288,
      "req": "note.add",
      "when": 1663343125,
      "file": "sensors.qo",
      "body": {
        "humidity": 69.88647200683693,
        "pressure": 993.6294496104914,
        "temp": 21.273027181770885
      },
      "tower_when": 1663343102,
      "tower_lat": 43.747037500000005,
      "tower_lon": -83.665859375,
      "tower_country": "US",
      "tower_location": "Waverly MI",
      "tower_timezone": "America/Detroit",
      "tower_id": "310,410,20483,184692496"
    }
  ]
}

Get Device Sessions Notehub

Get all session events by ProjectUID and DeviceUID.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/sessions
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

pageSize

integer (optional)

Specifies the number of sessions to be returned by a request (default 50).

pageNum

integer (optional)

Specifies the page number of the results returned (useful when the pageSize is less than the total number of sessions that could be returned). When provided, the pageNum must be >= 1.

curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/sessions'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
};
apiInstance.getDeviceSessions(projectUID, deviceUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/sessions?pageSize=<pageSize>&pageNum=<pageNum>'
    -H 'Authorization: Bearer <access_token>'
Response Members

session

string

The globally-unique SessionUID for the device's current Notehub session.

device

string

The device's globally-unique DeviceUID.

product

string

The globally-unique ProductUID.

fleets

array

An array of device fleets to which this Notecard belongs.

cell

string

A combination of the mcc, mnc, lac, and cid values, denoting the cell tower where the session originated.

rssi

integer

The "Received Signal Strength Indicator" value (0 being the best possible signal strength).

sinr

integer

The "Signal to Interference and Noise Ratio" value (the higher the value the better the signal strength).

rsrp

integer

The "Reference Signal Received Power" value (the higher the value the stronger the power).

rsrq

integer

The "Reference Signal Received Quality" value (the higher the value the better the signal quality).

bars

integer

A general measure of the quality and strength of the cellular connection (with 4 being the highest quality).

rat

string

The "Radio Access Technology" (i.e. the underlying connection method for the cellular network).

bearer

string

The tunnel used to connect the device to Packet Data Networks (PDNs).

ip

string

The IP address of the Notehub.io handler.

iccid

string

The "Integrated Circuit Card Identifier" of the SIM on the device.

apn

string

The "Access Point Name" for Notehub.

tower

object

Information about the cell tower used for this Notehub session.

tri

object

Information about the triangulation method(s) used for this Notehub session (only if triangulation was utilized).

when

UNIX Epoch time

Last known capture time of a Note routed through this session.

voltage

decimal

The voltage of the attached power source.

temp

decimal

The temperature (in Celsius) as reported by the onboard temperature sensor.

continuous

boolean

Whether or not the Notecard is in the continuous connectivity mode.

tls

boolean

Whether or not TLS was used to secure this session.

work

UNIX Epoch time

The last time an update was made (e.g. a Notefile was added/updated) or other "work" was performed for this session.

events

integer

The number of events routed in this session.

moved

UNIX Epoch time

The last time motion was detected for this session.

orientation

string

The physical orientation of the Notecard.

trigger

string

The reason this session was initiated.

hp_*

integer

The hp_* values report "high power" statistics about when the modem was powered on. One cycle is one power on/off of the modem.

period

object

Information denoting the approximate data usage, TCP sessions, and Notes sent in this session.

has_more

boolean

Whether or not there are additional sessions to display.

Example Response
{
  "sessions": [
    {
      "session": "d76689be-37cd-423c-b695-7e0c19a2a264",
      "device": "dev:000000000000000",
      "product": "product:com.blues.demo:project",
      "fleets": ["fleet:46be9834-5te6-42c1-0000-b5ea05e248d7"],
      "cell": "310,410,17169,77315594",
      "rssi": -61,
      "sinr": 17,
      "rsrp": -91,
      "rsrq": -13,
      "bars": 2,
      "rat": "lte",
      "bearer": "LTE FDD",
      "ip": "10.68.56.193",
      "iccid": "89011704278500000000",
      "apn": "a-notehub.com.attz",
      "tower": {
        "time": 1667250835,
        "n": "Shorewood Hills WI",
        "c": "US",
        "lat": 43.0742625,
        "lon": -89.44239062499999,
        "zone": "America/Chicago",
        "mcc": 310,
        "mnc": 410,
        "lac": 17169,
        "cid": 77315594,
        "l": "86MG3HF5+P25",
        "count": 7,
        "towers": 1
      },
      "tri": {},
      "when": 1667251044,
      "voltage": 4.174,
      "temp": 24.437,
      "continuous": true,
      "tls": true,
      "work": 1667251046,
      "events": 14,
      "moved": 1667250807,
      "orientation": "face-up",
      "trigger": "first sync; continuous connection mode",
      "hp_secs_total": 7659,
      "hp_secs_data": 7659,
      "hp_cycles_total": 3,
      "hp_cycles_data": 3,
      "period": {
        "since": 1667250832,
        "duration": 215,
        "bytes_rcvd": 2501,
        "bytes_sent": 4138,
        "sessions_tls": 1,
        "notes_sent": 12
      }
    }
  ],
  "has_more": true
}

Get Fleet Devices Notehub

Get an array of devices associated with a fleet.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/fleets/{fleetUID}/devices
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • fleetUID - The FleetUID of a Notehub fleet.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

pageSize

integer (optional)

Specifies the number of devices to be returned by a request (default 50).

pageNum

integer (optional)

Specifies the page number of the results returned (useful when the pageSize is less than the total number of devices that could be returned). When provided, the pageNum must be >= 1.

deviceUID

array (optional)

An array of DeviceUIDs of Notehub devices.

tag

Array (optional)

An array of one or more tags to filter the devices by.

serialNumber

Array (optional)

An array of device serial numbers to filter by.

notecardFirmware

Array (optional)

An array of one or more Notecard firmware versions to filter the devices by. Any numeric portion of the firmware name like "7.4.2.16888" or "7.4" is acceptable.

location

Array (optional)

An array of one or more locations to filter the devices by. Provide city, state, or country code like "Boston, MA", "Boston", "MA", or "Guildford, ENG, GB" (this field supports partial/case insensitive matches).

hostFirmware

Array (optional)

An array of one or more host firmware versions to filter the devices by. Any string of host firmware like "foo-3.4" or "8.7.6" or "baz-bar-01" is acceptable.

productUID

Array (optional)

An array of one or more ProductUIDs to filter the devices by.

sku

Array (optional)

An array of one or more Notecard SKUs to filter the devices by.

curl -X GET
   -L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/devices'
   -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  deviceUID: ["null"], // [String] | A Device UID.
  tag: ["null"], // [String] | Tag filter
  serialNumber: ["null"], // [String] | Serial number filter
  notecardFirmware: ["null"], // [String] | Firmware version filter
  location: ["null"], // [String] | Location filter
  hostFirmware: ["null"], // [String] | Host firmware filter
  productUID: ["null"], // [String] |
  sku: ["null"] // [String] | SKU filter
};
apiInstance.getProjectFleetDevices(projectUID, fleetUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

uid

string

The globally-unique identifier of the device.

serial_number

string

The user-defined serial number of the device.

provisioned

string

The date and time this device was first provisioned, or put into use.

last_activity

string

The date and time this device was last seen by Notehub.

contact

object

Contact information for this device, specified via environment variables.

product_uid

string

The ProductUID this device is associated with.

fleet_uids

array

An array of globally-unique identifiers for the fleet(s) this device is associated with.

tower_info

object

An object containing data about the cellular tower last accessed by this device.

tower_info.mcc

integer

The mobile country code of the cell tower.

tower_info.mnc

integer

The mobile network code of the cell tower, which identifies the mobile operator.

tower_info.lac

integer

The location area code of the cell tower, which is a unique identifier of the current location area.

tower_info.cell_id

integer

The Cell ID or CID of the cell tower. This is a unique number used to identify each Base Transceiver Station (BTS) or sector of a BTS within a location area code.

tower_location

object

An object containing information about the physical location of the cell tower.

gps_location

object

An object containing information about the physical location of the device, based on GPS coordinates.

triangulated_location

object

An object containing information about the physical location of the device based on triangulated data calculated by multiple cell towers.

voltage

decimal

The most recent measure of the voltage from the onboard voltage monitor.

temperature

decimal

The most recent temperature measure in celsius from the onboard temperature sensor.

has_more

boolean

Defines whether or not there are additional devices beyond this list.

Example Response
{
   "devices":[
      {
         "uid":"dev:000000000000000",
         "serial_number":"",
         "provisioned":"2021-02-11T02:37:16Z",
         "last_activity":"2021-05-11T19:37:08Z",
         "contact":null,
         "product_uid":"product:com.your-company.your-name:project",
         "fleet_uids":"[fleet:00000000-0000-0000-0000-000000000000]",
         "tower_info":{
            "mcc":310,
            "mnc":410,
            "lac":12345,
            "cell_id":12345678
         },
         "tower_location":{
            "when":"2021-05-11T19:34:23Z",
            "name":"Cassville MO",
            "country":"US",
            "timezone":"America/Chicago",
            "latitude":36.665537500000006,
            "longitude":-93.850109375
         },
         "gps_location":{
            "same properties as tower_location"
         },
         "triangulated_location":{
            "same properties as tower_location"
         },
         "voltage":5.15,
         "temperature":23.75
      }
   ],
   "has_more":false
}

Get Note Notehub

Retrieves a Note from a DB Notefile. .qo/.qos Notes must be read from the Notehub event table using the Event API.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
  • notefileID - The filename of the Notefile.
  • noteID - The unique Note ID.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

delete

boolean (optional)

true to delete the Note after retrieving it.

deleted

boolean (optional)

true to allow retrieval of a deleted Note.

curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/<file>/<note>'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let opts = {
  _delete: true, // Boolean | Whether to delete the note from the DB notefile
  deleted: true, // Boolean | Whether to return deleted notes
};
apiInstance.handleNoteGet(projectUID, deviceUID, notefileID, noteID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

note

string

The Note ID.

body

JSON object

The JSON body, if contained in the Note.

payload

base64 string

The payload, if contained in the Note.

time

UNIX Epoch time

The time the Note was added to the Notecard or Notehub.

Example Response
{
  "note": "note-id",
  "body": {
    "api-key1": "api-val1"
  },
  "time": 1598909219
}

Get Note Changes Notehub

The Get Note Changes API is used to incrementally retrieve changes within a specific Notefile.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/changes
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
  • notefileID - The filename of the Notefile.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

tracker

string (optional)

The change tracker ID. This value is developer-defined and can be used across both the Notecard APIs (note.changes and file.changes) and Notehub APIs (Get Note Changes and Get File Changes).

max

integer (optional)

The maximum number of Notes to return in the request.

start

boolean (optional)

true to reset the tracker to the beginning.

stop

boolean (optional)

true to delete the tracker.

deleted

boolean (optional)

true to return deleted Notes with this request. Deleted notes are only persisted in a database Notefile (.db/.dbs) between the time of Note deletion on the Notecard and the time that a sync with Notehub takes place. As such, this boolean will have no effect after a sync or on queue notefiles (.q*).

delete

boolean (optional)

true to delete the Notes returned by the request.

reset

boolean (optional)

true to reset a change tracker.

curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/<file>/changes'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let opts = {
  tracker: "tracker_example", // String | The change tracker ID.
  max: 56, // Number | The maximum number of Notes to return in the request.
  start: true, // Boolean | true to reset the tracker to the beginning.
  stop: true, // Boolean | true to delete the tracker.
  deleted: true, // Boolean | true to return deleted notes.
  _delete: true, // Boolean | true to delete the notes returned by the request.
};
apiInstance.handleNoteChanges(projectUID, deviceUID, notefileID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/<file>/changes?tracker=<tracker>&start=<start>&delete=<delete>&max=<max>'
    -H 'Authorization: Bearer <access_token>'
Response Members

total

integer

The total number of Notes in the Notefile.

changes

integer

The number of pending changes in the Notefile.

notes

JSON object

An object with a key for each Note (for instance, the Note ID in a DB Notefile; For .qo and .qi Notes, these IDs are generated for internal management) and value object with the body of each Note and the Time the Note was added.

Example Response
{
  "changes": 4,
  "total": 4,
  "notes": {
    "setting-one": { "body": { "foo": "bar" }, "time": 1598918235 },
    "setting-two": { "body": { "foo": "bat" }, "time": 1598918245 },
    "setting-three": { "body": { "foo": "baz" }, "time": 1598918225 },
    "setting-four": { "body": { "foo": "foo" }, "time": 1598910532 }
  }
}
More information:
  • Using Change Trackers With Inbound Data

Add Note Notehub

Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist. The file must either be a DB Notefile or an inbound queue file (see notefileID argument below).

HTTP Method:POST
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
  • notefileID - The filename of the Notefile. The Notefile name must end in one of the following:
    • .qi for an incoming queue (Notehub to Notecard) with plaintext transport.
    • .qis for an incoming queue (Notehub to Notecard) with encrypted transport.
    • .db for a bidirectionally synchronized database with plaintext transport.
    • .dbs for a bidirectionally synchronized database with encrypted transport.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

body

JSON object (optional)

A JSON object to be enqueued. A Note must have either a body or a payload, and can have both.

payload

base64 string (optional)

A base64-encoded binary payload. A Note must have either a body or a payload, and can have both. If a Note template is not in use, payloads are limited to 250 bytes.

curl -X POST
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/<file>'
    -H 'Authorization: Bearer <access_token>'
    -d '{"body": {"temp": 72.22 }}'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let note = new NotehubJs.Note(); // Note | Body or payload of note to be added to the device
apiInstance.handleNoteAdd(projectUID, deviceUID, notefileID, note).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members
None: an empty object {} means success.
More information:
  • Inbound Requests and Shared Data

Update Note Notehub

Updates a Note in a DB Notefile by its ID, replacing the existing body and/or payload. Inbound Notefiles may not be updated.

HTTP Method:PUT
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
  • notefileID - The filename of the Notefile.
  • noteID - The unique Note ID.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

file

string

The name of the DB Notefile that contains the Note to update.

note

string

The unique Note ID.

body

JSON object

A JSON object to add to the Note. A Note must have either a body or payload, and can have both.

payload

base64 string

A base64-encoded binary payload. A Note must have either a body or payload, and can have both.

access_token

string

A Notehub API bearer token.

projectUID

string

The ProjectUID of a Notehub project.

deviceUID

string

The globally-unique DeviceUID of a device that currently exists within the specified ProjectUID.

You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.

curl -X PUT
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/<file>/<note>'
    -H 'Authorization: Bearer <access_token>'
    -d '{"body": {"interval": 60 }}'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let note = new NotehubJs.Note(); // Note | Body or payload of note to be added to the device
apiInstance
  .handleNoteCreateAdd(projectUID, deviceUID, notefileID, noteID, note)
  .then(
    () => {
      console.log("API called successfully.");
    },
    (error) => {
      console.error(error);
    }
  );
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)
Response Members
None: an empty object {} means success.

Delete Note Notehub

Delete Notes from a DB Notefile by its Note ID. To delete Notes from a .qi Notefile, use the Get Note Changes API with the delete:true argument

HTTP Method:DELETE
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
  • notefileID - The filename of the Notefile.
  • noteID - The unique Note ID.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X DELETE
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/<file>/<note>'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
apiInstance.handleNoteDelete(projectUID, deviceUID, notefileID, noteID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members
None: an empty object {} means success.

Send Signal Notehub

Send a signal from Notehub to a Notecard device.

HTTP Method:POST
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/signal
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
note

A Notecard can receive a signal with the hub.signal request.

Arguments

body

JSON object

The JSON object to send.

curl -X POST
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/signal'
    -H 'Authorization: Bearer <access_token>'
    -d '{"body":<body>}'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let body = new NotehubJs.Body(); // Body | Body or payload of signal to be sent to the device
apiInstance.handleNoteSignal(projectUID, deviceUID, body).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

connected

boolean

true if the Notecard is connected to Notehub.

Example Response
{
  "connected": true
}

Get Notefile Changes Notehub

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

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/files/changes
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

files

array of strings (optional)

One or more files to obtain change information from. Omit to return changes for all Notefiles.

tracker

string (optional)

ID of a change tracker to use to determine changes to Notefiles.

Change trackers are not supported on Notecard LoRa.

curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/files/changes?tracker=<tracker>&files=[<files>]'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let opts = {
  tracker: "tracker_example", // String | The change tracker ID.
  files: ["null"], // [String] | One or more files to obtain change information from.
};
apiInstance.handleNotefileChanges(projectUID, deviceUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

total

integer

The total of local Notes across all Notefiles. This includes Inbound Notes that have not been deleted, as well as outbound Notes that have yet to sync.

changes

integer

If a change tracker is used, the number of changes across all files.

info

JSON object

An object with a key for each Notefile that matched the request parameters, and value object with the changes and total for each file.

Example Response
{
  "changes": 5,
  "total": 5,
  "info": {
    "my-settings.db": { "changes": 3, "total": 3 },
    "other-settings.db": { "changes": 2, "total": 2 }
  }
}
More information:
  • Handling Inbound Notes

  • Using a Change Tracker Across Notefiles

Get Pending Notefile Changes Notehub

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

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/files/changes/pending
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:viewer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X GET
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/files/changes/pending'
    -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.handleNotefileChangesPending(projectUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

total

integer

The total of unsynced notes across all Notefiles.

changes

integer

The number of changes across all files.

pending

boolean

true if there are pending changes.

info

JSON object

An object with a key for each Notefile and value object with the changes and total for each file.

Example Response
{
  "total": 3,
  "changes": 3,
  "pending": true,
  "info": {
    "sensors.qo": { "changes": 3, "total": 3 }
  }
}

Delete Notefile Notehub

Deletes Notefiles and the Notes they contain.

HTTP Method:DELETE
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/files
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

files

array of strings

One or more files to delete.

curl -X DELETE
    -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/files'
    -H 'Authorization: Bearer <access_token>'
    -d '{"files": [<files>]}'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let handleNotefileDeleteRequest = new NotehubJs.HandleNotefileDeleteRequest(); // HandleNotefileDeleteRequest |
apiInstance
  .handleNotefileDelete(projectUID, deviceUID, handleNotefileDeleteRequest)
  .then(
    () => {
      console.log("API called successfully.");
    },
    (error) => {
      console.error(error);
    }
  );
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)
Response Members
None: an empty object {} means success.

Provision Device Notehub

Provision a device to a specific ProductUID.

HTTP Method:POST
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/provision
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments

product_uid

string

The ProductUID from a Notehub project.

device_sn

string (optional)

The user-defined serial number of the device.

fleet_uids

array of strings (optional)

An array of FleetUIDs to associate with the device.

curl -X POST
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/provision'
     -H 'Authorization: Bearer <access_token>'
     -d '{"product_uid":"<product_uid>"}'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let postProvisionProjectDeviceRequest = new NotehubJs.PostProvisionProjectDeviceRequest(); // PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID
apiInstance.postProvisionProjectDevice(projectUID, deviceUID, postProvisionProjectDeviceRequest).then((data) => {
  console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
  console.error(error);
});
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", "fleet_uid_2"]
    }
    post_provision_project_device_request = notehub_py.PostProvisionProjectDeviceRequest(project_device_props) # PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID

    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)
curl -X POST
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/provision'
     -H 'Authorization: Bearer <access_token>'
     -d '{"product_uid":"<product_uid>", "device_sn":"<serial_number>", "fleet_uids":["<fleet_uid>"]}'

Get Device Public Key Notehub

Get the static public encryption key associated with a specific Notecard device.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/public-key
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
  • deviceUID - The DeviceUID of a Notehub device. You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X GET
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/public-key'
     -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDevicePublicKey(projectUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

uid

string

The unique DeviceUID for the selected Notecard device.

key

string

The static public encryption key for the selected Notecard device.

Example Response
{
  "uid":"dev:864622087654321",
  "key":"-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYAEMU422hb6pAYvcG3dXf7TgKNdjlldh5t1ozxd0FmSq53Y0+OZik4/LivDJPpbWmobdxqOlLZ2rQqfzKjku\nlhs+xgkpXQEyu+3ljl2352kl323kwBq\n-----END PUBLIC KEY-----\n"
}
More information:
  • Encrypting and Decrypting Data with the Notecard

Get Public Keys Notehub

Get the static public encryption keys stored on all Notecard devices associated with a specific ProjectUID.

HTTP Method:GET
URL:https://api.notefile.net/v1/projects/{projectUID}/devices/public-keys
Path Parameters:
  • projectUID - The ProjectUID of a Notehub project.
Minimum Notehub project-level role:developer
Required HTTP Headers:Authorization: Bearer <access_token>, where the access token is a Notehub API bearer token.
Arguments
None
curl -X GET
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/public-keys'
     -H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";

let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
};
apiInstance.getProjectDevicePublicKeys(projectUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
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)
Response Members

device_public_keys

array

An array of unique DeviceUIDs and public keys stored on each Notecard associated with the specified Notehub project.

Example Response
{
   "device_public_keys":[
      {
         "uid":"dev:864475012345678",
         "key":"-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4GqlEk/RNoX8DUkCnP7C0moL8Y\ncxGyTkALQY6v669Gviic0g0p1jhL7GpEQAUkWg8Ah+bB04V+5aTV2/scClz\nv0g/VanrLz8UH6HIRWgiSJvXZBid05d9\n-----END PUBLIC KEY-----\n"
      },
      {
         "uid":"dev:864622087654321",
         "key":"-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYAEMU422hb6pAYvcG3dXf7TgKNdjlldh5t1ozxd0FmSq53Y0+OZik4/LivDJPpbWmobdxqOlLZ2rQqfzKjku\nlhs+xgkpXQEyu+3ljl2352kl323kwBq\n-----END PUBLIC KEY-----\n"
      },
   ],
   "has_more":false
}
More information:
  • Encrypting and Decrypting Data with the Notecard
Billing Account API Event API
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