Notehub JS Library Overview
The Notehub JS library is an npm package built for JavaScript applications. It provides a quick, JavaScript-friendly way to connect to the Notehub API, and perform Notehub API requests with a clean, intuitive interface.
Installation
You can install the Notehub JS library in any JavaScript application using the steps below.
Start by installing the @blues-inc/notehub-js package in your project using
your package manager of choice. The example below uses npm:
npm install @blues-inc/notehub-jsOnce the package is installed, you can import the library using either import
or require:
Using import:
import * as NotehubJs from "@blues-inc/notehub-js";Using import in a TypeScript project will currently cause an error because
type definitions are not yet included. To resolve this, create a .d.ts
file in your project (for example, types/notehub-js.d.ts) with the following
declaration:
declare module "@blues-inc/notehub-js";Using require:
const NotehubJs = require("@blues-inc/notehub-js");Usage
Authentication
The Notehub JS library authenticates using a Personal Access Token (PAT). Set your token once on the shared ApiClient instance before making any API calls:
import * as NotehubJs from "@blues-inc/notehub-js";
const defaultClient = NotehubJs.ApiClient.instance;
const auth = defaultClient.authentications["personalAccessToken"];
auth.accessToken = "YOUR_ACCESS_TOKEN";Finding Your Project UID
Most API methods require a ProjectUID —
a unique identifier for your Notehub project in the format app:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. You can find it on your project's Settings page in Notehub.
Example: Fetching Events
Here's a complete example that retrieves the most recent events from a project:
import * as NotehubJs from "@blues-inc/notehub-js";
const defaultClient = NotehubJs.ApiClient.instance;
const auth = defaultClient.authentications["personalAccessToken"];
auth.accessToken = "YOUR_ACCESS_TOKEN";
const projectUID = "app:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
const eventApi = new NotehubJs.EventApi();
eventApi.getEvents(projectUID, { pageSize: 10 }).then(
(data) => console.log(data),
(error) => console.error(error)
);
// If you're using TypeScript you may need to add types to avoid
// compilation errors
// eventApi.getEvents(projectUID, { pageSize: 10 }).then(
// (data: unknown) => console.log(data),
// (error: unknown) => console.error(error)
// );The library also supports async/await:
try {
const data = await eventApi.getEvents(projectUID, { pageSize: 10 });
console.log(data);
} catch (error) {
console.error(error);
}Usage Limits
The Notehub API has usage limits. Exceeding the request threshold may result in 429 responses. See Notehub API Usage Limits for details.
API Reference
| API | Description |
|---|---|
| Billing Account API | Retrieve billing accounts accessible by your token |
| Device API | Manage devices, environment variables, and Notefiles |
| Event API | Query project and fleet events, with cursor and filter support |
| Jobs API | Manage and run Notehub batch jobs |
| Monitor API | Create and manage monitors that trigger alerts on event data |
| Project API | Manage projects, fleets, firmware, environment variables, and more |
| Route API | Create and manage routes for forwarding event data |
| Usage API | Query data, event, route log, and session usage by time range |
Billing Account API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| getBillingAccount | GET /v1/billing-accounts/{billingAccountUID} | |
| getBillingAccountBalanceHistory | GET /v1/billing-accounts/{billingAccountUID}/balance-history | |
| getBillingAccounts | GET /v1/billing-accounts |
getBillingAccount
GetBillingAccount200Response getBillingAccount(billingAccountUID)
Get Billing Account Information
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.BillingAccountApi();
let billingAccountUID = "00000000-0000-0000-000000000001"; // String |
apiInstance.getBillingAccount(billingAccountUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| billingAccountUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getBillingAccountBalanceHistory
GetBillingAccountBalanceHistory200Response getBillingAccountBalanceHistory(billingAccountUID, opts)
Get Billing Account Balance history, only enterprise supported
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.BillingAccountApi();
let billingAccountUID = "00000000-0000-0000-000000000001"; // String |
let opts = {
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
};
apiInstance.getBillingAccountBalanceHistory(billingAccountUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| billingAccountUID | String | ||
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
Return type
GetBillingAccountBalanceHistory200Response
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getBillingAccounts
GetBillingAccounts200Response getBillingAccounts()
Get Billing Accounts accessible by the api_key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.BillingAccountApi();
apiInstance.getBillingAccounts().then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
This endpoint does not need any parameter.
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Device API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| addDbNote | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
| addQiNote | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | |
| createNotefile | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID} | |
| deleteDevice | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID} | |
| deleteDeviceEnvironmentVariable | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key} | |
| deleteNote | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
| deleteNotefiles | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files | |
| disableDevice | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable | |
| enableDevice | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable | |
| getDbNote | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
| getDevice | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID} | |
| getDeviceEnvironmentHierarchy | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy | Get environment variable hierarchy for a device |
| getDeviceEnvironmentVariables | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | |
| getDeviceEnvironmentVariablesByPin | GET /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | |
| getDeviceHealthLog | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log | |
| getDeviceLatestEvents | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest | |
| getDevicePlans | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans | |
| getDevicePublicKey | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key | |
| getDevicePublicKeys | GET /v1/projects/{projectOrProductUID}/devices/public-keys | |
| getDeviceSessions | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions | |
| getDevices | GET /v1/projects/{projectOrProductUID}/devices | |
| getFleetDevices | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices | |
| getNotefile | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | |
| listNotefiles | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files | |
| provisionDevice | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/provision | |
| setDeviceEnvironmentVariables | PUT /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | |
| setDeviceEnvironmentVariablesByPin | PUT /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | |
| signalDevice | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal | |
| updateDbNote | PUT /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} |
addDbNote
addDbNote(projectOrProductUID, deviceUID, notefileID, noteID, noteInput)
Add a Note to a .db notefile. if noteID is '-' then payload is ignored and empty notefile is created
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let noteInput = new NotehubJs.NoteInput(); // NoteInput | Body or payload of note to be added to the device
apiInstance
.addDbNote(projectOrProductUID, deviceUID, notefileID, noteID, noteInput)
.then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| notefileID | String | ||
| noteID | String | ||
| noteInput | NoteInput | Body or payload of note to be added to the device |
Return type
null (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
addQiNote
addQiNote(projectOrProductUID, deviceUID, notefileID, noteInput)
Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteInput = new NotehubJs.NoteInput(); // NoteInput | Body or payload of note to be added to the device
apiInstance
.addQiNote(projectOrProductUID, deviceUID, notefileID, noteInput)
.then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| notefileID | String | ||
| noteInput | NoteInput | Body or payload of note to be added to the device |
Return type
null (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
createNotefile
createNotefile(projectOrProductUID, deviceUID, notefileID)
Creates an empty Notefile on the device.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
apiInstance.createNotefile(projectOrProductUID, deviceUID, notefileID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| notefileID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
deleteDevice
deleteDevice(projectOrProductUID, deviceUID)
Delete Device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.deleteDevice(projectOrProductUID, deviceUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
deleteDeviceEnvironmentVariable
EnvironmentVariables deleteDeviceEnvironmentVariable(projectOrProductUID, deviceUID, key)
Delete environment variable of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance
.deleteDeviceEnvironmentVariable(projectOrProductUID, deviceUID, key)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| key | String | The environment variable key to delete. |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
deleteNote
deleteNote(projectOrProductUID, deviceUID, notefileID, noteID)
Delete a note from a .db or .qi notefile
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
apiInstance.deleteNote(projectOrProductUID, deviceUID, notefileID, noteID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| notefileID | String | ||
| noteID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
deleteNotefiles
deleteNotefiles(projectOrProductUID, deviceUID, deleteNotefilesRequest)
Deletes Notefiles and the Notes they contain.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let deleteNotefilesRequest = new NotehubJs.DeleteNotefilesRequest(); // DeleteNotefilesRequest |
apiInstance
.deleteNotefiles(projectOrProductUID, deviceUID, deleteNotefilesRequest)
.then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| deleteNotefilesRequest | DeleteNotefilesRequest |
Return type
null (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
disableDevice
disableDevice(projectOrProductUID, deviceUID)
Disable Device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.disableDevice(projectOrProductUID, deviceUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
enableDevice
enableDevice(projectOrProductUID, deviceUID)
Enable Device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.enableDevice(projectOrProductUID, deviceUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDbNote
GetDbNote200Response getDbNote(projectOrProductUID, deviceUID, notefileID, noteID, opts)
Get a note from a .db or .qi notefile
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // 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
.getDbNote(projectOrProductUID, deviceUID, notefileID, noteID, opts)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| notefileID | String | ||
| noteID | String | ||
| _delete | Boolean | Whether to delete the note from the DB notefile | [optional] |
| deleted | Boolean | Whether to return deleted notes | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDevice
Device getDevice(projectOrProductUID, deviceUID)
Get Device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDevice(projectOrProductUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceEnvironmentHierarchy
EnvTreeJsonNode getDeviceEnvironmentHierarchy(projectOrProductUID, deviceUID)
Get environment variable hierarchy for a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDeviceEnvironmentHierarchy(projectOrProductUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceEnvironmentVariables
GetDeviceEnvironmentVariablesByPin200Response getDeviceEnvironmentVariables(projectOrProductUID, deviceUID)
Get environment variables of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDeviceEnvironmentVariables(projectOrProductUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
GetDeviceEnvironmentVariablesByPin200Response
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceEnvironmentVariablesByPin
GetDeviceEnvironmentVariablesByPin200Response getDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken)
Get environment variables of a device with device pin authorization
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let apiInstance = new NotehubJs.DeviceApi();
let productUID = "com.blues.bridge:sensors"; // String |
let deviceUID = "dev:000000000000000"; // String |
let xAuthToken = "xAuthToken_example"; // String | For accessing endpoints by Device pin.
apiInstance
.getDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| productUID | String | ||
| deviceUID | String | ||
| xAuthToken | String | For accessing endpoints by Device pin. |
Return type
GetDeviceEnvironmentVariablesByPin200Response
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceHealthLog
GetDeviceHealthLog200Response getDeviceHealthLog(projectOrProductUID, deviceUID, opts)
Get Device Health Log
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let opts = {
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
logType: ["null"], // [String] | Return only specified log types
};
apiInstance.getDeviceHealthLog(projectOrProductUID, deviceUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| logType | [String] | Return only specified log types | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceLatestEvents
GetDeviceLatestEvents200Response getDeviceLatestEvents(projectOrProductUID, deviceUID)
Get Device Latest Events
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDeviceLatestEvents(projectOrProductUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
GetDeviceLatestEvents200Response
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDevicePlans
GetDevicePlans200Response getDevicePlans(projectOrProductUID, deviceUID)
Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDevicePlans(projectOrProductUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDevicePublicKey
GetDevicePublicKey200Response getDevicePublicKey(projectOrProductUID, deviceUID)
Get Device Public Key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDevicePublicKey(projectOrProductUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDevicePublicKeys
GetDevicePublicKeys200Response getDevicePublicKeys(projectOrProductUID, opts)
Get Device Public Keys of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getDevicePublicKeys(projectOrProductUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] |
Return type
GetDevicePublicKeys200Response
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceSessions
GetDeviceSessions200Response getDeviceSessions(projectOrProductUID, deviceUID, opts)
Get Device Sessions
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
firstSync: false, // Boolean | When true, filters results to only show first sync sessions
};
apiInstance.getDeviceSessions(projectOrProductUID, deviceUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] | |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| firstSync | Boolean | When true, filters results to only show first sync sessions | [optional] [default to false] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDevices
GetDevices200Response getDevices(projectOrProductUID, opts)
Get Devices of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "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.getDevices(projectOrProductUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] | |
| deviceUID | [String] | A Device UID. | [optional] |
| tag | [String] | Tag filter | [optional] |
| serialNumber | [String] | Serial number filter | [optional] |
| fleetUID | [String] | [optional] | |
| notecardFirmware | [String] | Firmware version filter | [optional] |
| location | [String] | Location filter | [optional] |
| hostFirmware | [String] | Host firmware filter | [optional] |
| productUID | [String] | [optional] | |
| sku | [String] | SKU filter | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getFleetDevices
GetDevices200Response getFleetDevices(projectOrProductUID, fleetUID, opts)
Get Devices of a Fleet within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "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.getFleetDevices(projectOrProductUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] | |
| deviceUID | [String] | A Device UID. | [optional] |
| tag | [String] | Tag filter | [optional] |
| serialNumber | [String] | Serial number filter | [optional] |
| notecardFirmware | [String] | Firmware version filter | [optional] |
| location | [String] | Location filter | [optional] |
| hostFirmware | [String] | Host firmware filter | [optional] |
| productUID | [String] | [optional] | |
| sku | [String] | SKU filter | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getNotefile
GetNotefile200Response getNotefile(projectOrProductUID, deviceUID, notefileID, opts)
For .qi files, returns the queued up notes. For .db files, returns all notes in the notefile
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let opts = {
max: 56, // Number | The maximum number of Notes to return in the request.
deleted: true, // Boolean | true to return deleted notes.
_delete: true, // Boolean | true to delete the notes returned by the request.
};
apiInstance.getNotefile(projectOrProductUID, deviceUID, notefileID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| notefileID | String | ||
| max | Number | The maximum number of Notes to return in the request. | [optional] |
| deleted | Boolean | true to return deleted notes. | [optional] |
| _delete | Boolean | true to delete the notes returned by the request. | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
listNotefiles
[Notefile] listNotefiles(projectOrProductUID, deviceUID, opts)
Lists .qi and .db files for the device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let opts = {
files: ["null"], // [String] | One or more files to obtain change information from.
pending: true, // Boolean | show only files that are pending sync to the Notecard
};
apiInstance.listNotefiles(projectOrProductUID, deviceUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| files | [String] | One or more files to obtain change information from. | [optional] |
| pending | Boolean | show only files that are pending sync to the Notecard | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
provisionDevice
Object provisionDevice(projectOrProductUID, deviceUID, provisionDeviceRequest)
Provision Device for a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let provisionDeviceRequest = new NotehubJs.ProvisionDeviceRequest(); // ProvisionDeviceRequest | Provision a device to a specific ProductUID
apiInstance
.provisionDevice(projectOrProductUID, deviceUID, provisionDeviceRequest)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| provisionDeviceRequest | ProvisionDeviceRequest | Provision a device to a specific ProductUID |
Return type
Object
HTTP request headers
- Content-Type: application/json
- Accept: application/json
setDeviceEnvironmentVariables
EnvironmentVariables setDeviceEnvironmentVariables(projectOrProductUID, deviceUID, environmentVariables)
Set environment variables of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
.setDeviceEnvironmentVariables(
projectOrProductUID,
deviceUID,
environmentVariables
)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
setDeviceEnvironmentVariablesByPin
EnvironmentVariables setDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken, environmentVariables)
Set environment variables of a device with device pin authorization
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let apiInstance = new NotehubJs.DeviceApi();
let productUID = "com.blues.bridge:sensors"; // String |
let deviceUID = "dev:000000000000000"; // String |
let xAuthToken = "xAuthToken_example"; // String | For accessing endpoints by Device pin.
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
.setDeviceEnvironmentVariablesByPin(
productUID,
deviceUID,
xAuthToken,
environmentVariables
)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| productUID | String | ||
| deviceUID | String | ||
| xAuthToken | String | For accessing endpoints by Device pin. | |
| environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
Return type
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
signalDevice
SignalDevice200Response signalDevice(projectOrProductUID, deviceUID, body)
Send a signal from Notehub to a Notecard.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let body = new NotehubJs.Body(); // Body | Body or payload of signal to be sent to the device
apiInstance.signalDevice(projectOrProductUID, deviceUID, body).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| body | Body | Body or payload of signal to be sent to the device |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
updateDbNote
updateDbNote(projectOrProductUID, deviceUID, notefileID, noteID, noteInput)
Update a note in a .db or .qi notefile
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let noteInput = new NotehubJs.NoteInput(); // NoteInput | Body or payload of note to be added to the device
apiInstance
.updateDbNote(projectOrProductUID, deviceUID, notefileID, noteID, noteInput)
.then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| notefileID | String | ||
| noteID | String | ||
| noteInput | NoteInput | Body or payload of note to be added to the device |
Return type
null (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
Event API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| getEvents | GET /v1/projects/{projectOrProductUID}/events | |
| getEventsByCursor | GET /v1/projects/{projectOrProductUID}/events-cursor | |
| getFleetEvents | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events | |
| getFleetEventsByCursor | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor | |
| getRouteLogsByEvent | GET /v1/projects/{projectOrProductUID}/events/{eventUID}/route-logs |
getEvents
GetEvents200Response getEvents(projectOrProductUID, opts)
Get Events of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
deviceUID: ["null"], // [String] | A Device UID.
sortBy: "'captured'", // String |
sortOrder: "'asc'", // String |
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
dateType: "uploaded", // String | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
format: "'json'", // String | Response format (JSON or CSV)
serialNumber: ["null"], // [String] | Filter by Serial Number
fleetUID: ["null"], // [String] | Filter by Fleet UID
sessionUID: ["null"], // [String] | Filter by Session UID
eventUID: ["null"], // [String] | Filter by Event UID
selectFields: "selectFields_example", // String | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output.
};
apiInstance.getEvents(projectOrProductUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] | |
| deviceUID | [String] | A Device UID. | [optional] |
| sortBy | String | [optional] [default to 'captured'] | |
| sortOrder | String | [optional] [default to 'asc'] | |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| dateType | String | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters | [optional] [default to 'captured'] |
| systemFilesOnly | Boolean | [optional] | |
| files | String | [optional] | |
| format | String | Response format (JSON or CSV) | [optional] [default to 'json'] |
| serialNumber | [String] | Filter by Serial Number | [optional] |
| fleetUID | [String] | Filter by Fleet UID | [optional] |
| sessionUID | [String] | Filter by Session UID | [optional] |
| eventUID | [String] | Filter by Event UID | [optional] |
| selectFields | String | Comma-separated list of fields to select from JSON payload (e.g., "field1,field2.subfield,field3"), this will reflect the columns in the CSV output. | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, text/csv
getEventsByCursor
GetEventsByCursor200Response getEventsByCursor(projectOrProductUID, opts)
Get Events of a Project by cursor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
limit: 50, // Number |
cursor: "cursor_example", // String | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.
sortOrder: "'asc'", // String |
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
fleetUID: "fleetUID_example", // String |
deviceUID: ["null"], // [String] | A Device UID.
};
apiInstance.getEventsByCursor(projectOrProductUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| limit | Number | [optional] [default to 50] | |
| cursor | String | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. | [optional] |
| sortOrder | String | [optional] [default to 'asc'] | |
| systemFilesOnly | Boolean | [optional] | |
| files | String | [optional] | |
| fleetUID | String | [optional] | |
| deviceUID | [String] | A Device UID. | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getFleetEvents
GetEvents200Response getFleetEvents(projectOrProductUID, fleetUID, opts)
Get Events of a Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "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.
sortBy: "'captured'", // String |
sortOrder: "'asc'", // String |
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
dateType: "uploaded", // String | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
format: "'json'", // String | Response format (JSON or CSV)
serialNumber: ["null"], // [String] | Filter by Serial Number
sessionUID: ["null"], // [String] | Filter by Session UID
eventUID: ["null"], // [String] | Filter by Event UID
selectFields: "selectFields_example", // String | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output.
};
apiInstance.getFleetEvents(projectOrProductUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] | |
| deviceUID | [String] | A Device UID. | [optional] |
| sortBy | String | [optional] [default to 'captured'] | |
| sortOrder | String | [optional] [default to 'asc'] | |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| dateType | String | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters | [optional] [default to 'captured'] |
| systemFilesOnly | Boolean | [optional] | |
| files | String | [optional] | |
| format | String | Response format (JSON or CSV) | [optional] [default to 'json'] |
| serialNumber | [String] | Filter by Serial Number | [optional] |
| sessionUID | [String] | Filter by Session UID | [optional] |
| eventUID | [String] | Filter by Event UID | [optional] |
| selectFields | String | Comma-separated list of fields to select from JSON payload (e.g., "field1,field2.subfield,field3"), this will reflect the columns in the CSV output. | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, text/csv
getFleetEventsByCursor
GetEventsByCursor200Response getFleetEventsByCursor(projectOrProductUID, fleetUID, opts)
Get Events of a Fleet by cursor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
limit: 50, // Number |
cursor: "cursor_example", // String | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.
sortOrder: "'asc'", // String |
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
deviceUID: ["null"], // [String] | A Device UID.
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
};
apiInstance.getFleetEventsByCursor(projectOrProductUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String | ||
| limit | Number | [optional] [default to 50] | |
| cursor | String | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. | [optional] |
| sortOrder | String | [optional] [default to 'asc'] | |
| systemFilesOnly | Boolean | [optional] | |
| files | String | [optional] | |
| deviceUID | [String] | A Device UID. | [optional] |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getRouteLogsByEvent
[RouteLog] getRouteLogsByEvent(projectOrProductUID, eventUID)
Get Route Logs by Event UID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let eventUID = "4506f411-dea6-44a0-9743-1130f57d7747"; // String |
apiInstance.getRouteLogsByEvent(projectOrProductUID, eventUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| eventUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Jobs API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| cancelJobRun | POST /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel | |
| createJob | POST /v1/projects/{projectOrProductUID}/jobs | |
| deleteJob | DELETE /v1/projects/{projectOrProductUID}/jobs/{jobUID} | |
| getJob | GET /v1/projects/{projectOrProductUID}/jobs/{jobUID} | |
| getJobRun | GET /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID} | |
| getJobRuns | GET /v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs | |
| getJobs | GET /v1/projects/{projectOrProductUID}/jobs | |
| runJob | POST /v1/projects/{projectOrProductUID}/jobs/{jobUID}/run |
cancelJobRun
CancelJobRun200Response cancelJobRun(projectOrProductUID, reportUID)
Cancel a running job execution
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let reportUID = "my-reconciliation-job-1707654321000"; // String | Unique identifier for a job run report
apiInstance.cancelJobRun(projectOrProductUID, reportUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| reportUID | String | Unique identifier for a job run report |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
createJob
CreateJob201Response createJob(projectOrProductUID, name, body)
Create a new batch job with an optional name
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let name = "name_example"; // String | Name for the job
let body = { key: null }; // Object | The job definition as raw JSON
apiInstance.createJob(projectOrProductUID, name, body).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| name | String | Name for the job | |
| body | Object | The job definition as raw JSON |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
deleteJob
DeleteJob200Response deleteJob(projectOrProductUID, jobUID)
Delete a batch job
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let jobUID = "my-reconciliation-job"; // String | Unique identifier for a batch job
apiInstance.deleteJob(projectOrProductUID, jobUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| jobUID | String | Unique identifier for a batch job |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getJob
Job getJob(projectOrProductUID, jobUID)
Get a specific batch job definition
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let jobUID = "my-reconciliation-job"; // String | Unique identifier for a batch job
apiInstance.getJob(projectOrProductUID, jobUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| jobUID | String | Unique identifier for a batch job |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getJobRun
JobRun getJobRun(projectOrProductUID, reportUID)
Get the result of a job execution
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let reportUID = "my-reconciliation-job-1707654321000"; // String | Unique identifier for a job run report
apiInstance.getJobRun(projectOrProductUID, reportUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| reportUID | String | Unique identifier for a job run report |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getJobRuns
GetJobRuns200Response getJobRuns(projectOrProductUID, jobUID, opts)
List all runs for a specific job
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let jobUID = "my-reconciliation-job"; // String | Unique identifier for a batch job
let opts = {
status: "status_example", // String | Filter runs by status
dryRun: true, // Boolean | Filter runs by dry run flag
};
apiInstance.getJobRuns(projectOrProductUID, jobUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| jobUID | String | Unique identifier for a batch job | |
| status | String | Filter runs by status | [optional] |
| dryRun | Boolean | Filter runs by dry run flag | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getJobs
GetJobs200Response getJobs(projectOrProductUID)
List all batch jobs for a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getJobs(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
runJob
RunJob200Response runJob(projectOrProductUID, jobUID, opts)
Execute a batch job
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let jobUID = "my-reconciliation-job"; // String | Unique identifier for a batch job
let opts = {
dryRun: false, // Boolean | Run job in dry-run mode without making actual changes
};
apiInstance.runJob(projectOrProductUID, jobUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| jobUID | String | Unique identifier for a batch job | |
| dryRun | Boolean | Run job in dry-run mode without making actual changes | [optional] [default to false] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Monitor API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| createMonitor | POST /v1/projects/{projectOrProductUID}/monitors | |
| deleteMonitor | DELETE /v1/projects/{projectOrProductUID}/monitors/{monitorUID} | |
| getMonitor | GET /v1/projects/{projectOrProductUID}/monitors/{monitorUID} | |
| getMonitors | GET /v1/projects/{projectOrProductUID}/monitors | |
| updateMonitor | PUT /v1/projects/{projectOrProductUID}/monitors/{monitorUID} |
createMonitor
Monitor createMonitor(projectOrProductUID, body)
Create a new Monitor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let body = new NotehubJs.Monitor(); // Monitor | Body or payload of monitor to be created
apiInstance.createMonitor(projectOrProductUID, body).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| body | Monitor | Body or payload of monitor to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
deleteMonitor
Monitor deleteMonitor(projectOrProductUID, monitorUID)
Delete Monitor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let monitorUID = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad"; // String |
apiInstance.deleteMonitor(projectOrProductUID, monitorUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| monitorUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getMonitor
Monitor getMonitor(projectOrProductUID, monitorUID)
Get Monitor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let monitorUID = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad"; // String |
apiInstance.getMonitor(projectOrProductUID, monitorUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| monitorUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getMonitors
[Monitor] getMonitors(projectOrProductUID)
Get list of defined Monitors
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getMonitors(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
updateMonitor
Monitor updateMonitor(projectOrProductUID, monitorUID, monitor)
Update Monitor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let monitorUID = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad"; // String |
let monitor = new NotehubJs.Monitor(); // Monitor | Body or payload of monitor to be created
apiInstance.updateMonitor(projectOrProductUID, monitorUID, monitor).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| monitorUID | String | ||
| monitor | Monitor | Body or payload of monitor to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
Project API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| addDeviceToFleets | PUT /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | |
| cloneProject | POST /v1/projects/{projectOrProductUID}/clone | |
| createFleet | POST /v1/projects/{projectOrProductUID}/fleets | |
| createProduct | POST /v1/projects/{projectOrProductUID}/products | |
| createProject | POST /v1/projects | |
| deleteDeviceFromFleets | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | |
| deleteFleet | DELETE /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | |
| deleteFleetEnvironmentVariable | DELETE /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables/{key} | |
| deleteProduct | DELETE /v1/projects/{projectOrProductUID}/products/{productUID} | |
| deleteProject | DELETE /v1/projects/{projectOrProductUID} | |
| deleteProjectEnvironmentVariable | DELETE /v1/projects/{projectOrProductUID}/environment_variables/{key} | |
| disableGlobalEventTransformation | POST /v1/projects/{projectOrProductUID}/global-transformation/disable | |
| downloadFirmware | GET /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | |
| enableGlobalEventTransformation | POST /v1/projects/{projectOrProductUID}/global-transformation/enable | |
| getAWSRoleConfig | GET /v1/projects/{projectOrProductUID}/aws-role-config | Get AWS role configuration for role-based authentication |
| getDeviceDfuHistory | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/history | |
| getDeviceDfuStatus | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status | |
| getDeviceFleets | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | |
| getDevicesDfuHistory | GET /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/history | |
| getDevicesDfuStatus | GET /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status | |
| getFirmwareInfo | GET /v1/projects/{projectOrProductUID}/firmware | |
| getFleet | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | |
| getFleetEnvironmentHierarchy | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy | Get environment variable hierarchy for a device |
| getFleetEnvironmentVariables | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables | |
| getFleets | GET /v1/projects/{projectOrProductUID}/fleets | |
| getNotefileSchemas | GET /v1/projects/{projectOrProductUID}/schemas | Get variable format for a notefile |
| getProducts | GET /v1/projects/{projectOrProductUID}/products | |
| getProject | GET /v1/projects/{projectOrProductUID} | |
| getProjectByProduct | GET /v1/products/{productUID}/project | |
| getProjectEnvironmentHierarchy | GET /v1/projects/{projectOrProductUID}/environment_hierarchy | Get environment variable hierarchy for a device |
| getProjectEnvironmentVariables | GET /v1/projects/{projectOrProductUID}/environment_variables | |
| getProjectMembers | GET /v1/projects/{projectOrProductUID}/members | |
| getProjects | GET /v1/projects | |
| performDfuAction | POST /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action} | |
| setFleetEnvironmentVariables | PUT /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables | |
| setGlobalEventTransformation | POST /v1/projects/{projectOrProductUID}/global-transformation | |
| setProjectEnvironmentVariables | PUT /v1/projects/{projectOrProductUID}/environment_variables | |
| updateFleet | PUT /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | |
| uploadFirmware | PUT /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} |
addDeviceToFleets
GetDeviceFleets200Response addDeviceToFleets(projectOrProductUID, deviceUID, addDeviceToFleetsRequest)
Add Device to Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let addDeviceToFleetsRequest = new NotehubJs.AddDeviceToFleetsRequest(); // AddDeviceToFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
apiInstance
.addDeviceToFleets(projectOrProductUID, deviceUID, addDeviceToFleetsRequest)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| addDeviceToFleetsRequest | AddDeviceToFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
cloneProject
Project cloneProject(projectOrProductUID, cloneProjectRequest)
Clone a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let cloneProjectRequest = new NotehubJs.CloneProjectRequest(); // CloneProjectRequest | Project to be cloned
apiInstance.cloneProject(projectOrProductUID, cloneProjectRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| cloneProjectRequest | CloneProjectRequest | Project to be cloned |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
createFleet
Fleet createFleet(projectOrProductUID, createFleetRequest)
Create Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createFleetRequest = new NotehubJs.CreateFleetRequest(); // CreateFleetRequest | Fleet to be added
apiInstance.createFleet(projectOrProductUID, createFleetRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| createFleetRequest | CreateFleetRequest | Fleet to be added |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
createProduct
Product createProduct(projectOrProductUID, createProductRequest)
Create Product within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createProductRequest = new NotehubJs.CreateProductRequest(); // CreateProductRequest | Product to be created
apiInstance.createProduct(projectOrProductUID, createProductRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| createProductRequest | CreateProductRequest | Product to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
createProject
Project createProject(createProjectRequest)
Create a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let createProjectRequest = new NotehubJs.CreateProjectRequest(); // CreateProjectRequest | Project to be created
apiInstance.createProject(createProjectRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| createProjectRequest | CreateProjectRequest | Project to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
deleteDeviceFromFleets
GetDeviceFleets200Response deleteDeviceFromFleets(projectOrProductUID, deviceUID, deleteDeviceFromFleetsRequest)
Remove Device from Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let deleteDeviceFromFleetsRequest =
new NotehubJs.DeleteDeviceFromFleetsRequest(); // DeleteDeviceFromFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
apiInstance
.deleteDeviceFromFleets(
projectOrProductUID,
deviceUID,
deleteDeviceFromFleetsRequest
)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| deleteDeviceFromFleetsRequest | DeleteDeviceFromFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
deleteFleet
deleteFleet(projectOrProductUID, fleetUID)
Delete Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.deleteFleet(projectOrProductUID, fleetUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
deleteFleetEnvironmentVariable
EnvironmentVariables deleteFleetEnvironmentVariable(projectOrProductUID, fleetUID, key)
Delete environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance
.deleteFleetEnvironmentVariable(projectOrProductUID, fleetUID, key)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String | ||
| key | String | The environment variable key to delete. |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
deleteProduct
deleteProduct(projectOrProductUID, productUID)
Delete a product
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let productUID = "com.blues.bridge:sensors"; // String |
apiInstance.deleteProduct(projectOrProductUID, productUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| productUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
deleteProject
deleteProject(projectOrProductUID)
Delete a Project by ProjectUID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.deleteProject(projectOrProductUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
deleteProjectEnvironmentVariable
EnvironmentVariables deleteProjectEnvironmentVariable(projectOrProductUID, key)
Delete an environment variable of a project by key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance.deleteProjectEnvironmentVariable(projectOrProductUID, key).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| key | String | The environment variable key to delete. |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
disableGlobalEventTransformation
disableGlobalEventTransformation(projectOrProductUID)
Disable the project-level event JSONata transformation
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.disableGlobalEventTransformation(projectOrProductUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
downloadFirmware
File downloadFirmware(projectOrProductUID, firmwareType, filename)
Download firmware binary
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let filename = "filename_example"; // String |
apiInstance.downloadFirmware(projectOrProductUID, firmwareType, filename).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| firmwareType | String | ||
| filename | String |
Return type
File
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream, application/json
enableGlobalEventTransformation
enableGlobalEventTransformation(projectOrProductUID)
Enable the project-level event JSONata transformation
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.enableGlobalEventTransformation(projectOrProductUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getAWSRoleConfig
AWSRoleConfig getAWSRoleConfig(projectOrProductUID)
Get AWS role configuration for role-based authentication
Returns the AWS Account ID and External ID needed to configure an IAM role trust policy for role-based authentication on AWS routes.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getAWSRoleConfig(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceDfuHistory
DeviceDfuHistory getDeviceDfuHistory(projectOrProductUID, deviceUID, firmwareType)
Get device DFU history for host or Notecard firmware
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let firmwareType = "firmwareType_example"; // String |
apiInstance
.getDeviceDfuHistory(projectOrProductUID, deviceUID, firmwareType)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| firmwareType | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceDfuStatus
DeviceDfuStatus getDeviceDfuStatus(projectOrProductUID, deviceUID, firmwareType)
Get device DFU history for host or Notecard firmware
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let firmwareType = "firmwareType_example"; // String |
apiInstance
.getDeviceDfuStatus(projectOrProductUID, deviceUID, firmwareType)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String | ||
| firmwareType | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDeviceFleets
GetDeviceFleets200Response getDeviceFleets(projectOrProductUID, deviceUID)
Get Device Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDeviceFleets(projectOrProductUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| deviceUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDevicesDfuHistory
DeviceDfuHistoryPage getDevicesDfuHistory(projectOrProductUID, firmwareType, opts)
Get host or Notecard DFU history for all devices that match the filter criteria
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
sortBy: "'captured'", // String |
sortOrder: "'asc'", // String |
deviceUID: ["null"], // [String] | A Device UID.
tag: ["null"], // [String] | Tag filter
serialNumber: ["null"], // [String] | Serial number filter
fleetUID: "fleetUID_example", // 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.getDevicesDfuHistory(projectOrProductUID, firmwareType, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| firmwareType | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] | |
| sortBy | String | [optional] [default to 'captured'] | |
| sortOrder | String | [optional] [default to 'asc'] | |
| deviceUID | [String] | A Device UID. | [optional] |
| tag | [String] | Tag filter | [optional] |
| serialNumber | [String] | Serial number filter | [optional] |
| fleetUID | String | [optional] | |
| notecardFirmware | [String] | Firmware version filter | [optional] |
| location | [String] | Location filter | [optional] |
| hostFirmware | [String] | Host firmware filter | [optional] |
| productUID | [String] | [optional] | |
| sku | [String] | SKU filter | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getDevicesDfuStatus
DeviceDfuStatusPage getDevicesDfuStatus(projectOrProductUID, firmwareType, opts)
Get host or Notecard DFU history for all devices that match the filter criteria
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
sortBy: "'captured'", // String |
sortOrder: "'asc'", // String |
deviceUID: ["null"], // [String] | A Device UID.
tag: ["null"], // [String] | Tag filter
serialNumber: ["null"], // [String] | Serial number filter
fleetUID: "fleetUID_example", // 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.getDevicesDfuStatus(projectOrProductUID, firmwareType, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| firmwareType | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] | |
| sortBy | String | [optional] [default to 'captured'] | |
| sortOrder | String | [optional] [default to 'asc'] | |
| deviceUID | [String] | A Device UID. | [optional] |
| tag | [String] | Tag filter | [optional] |
| serialNumber | [String] | Serial number filter | [optional] |
| fleetUID | String | [optional] | |
| notecardFirmware | [String] | Firmware version filter | [optional] |
| location | [String] | Location filter | [optional] |
| hostFirmware | [String] | Host firmware filter | [optional] |
| productUID | [String] | [optional] | |
| sku | [String] | SKU filter | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getFirmwareInfo
[FirmwareInfo] getFirmwareInfo(projectOrProductUID, opts)
Get Available Firmware Information
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
product: "product_example", // String |
firmwareType: "firmwareType_example", // String |
version: "version_example", // String |
target: "target_example", // String |
filename: "notecard-7.2.2.16518$20240410043100.bin", // String |
md5: "md5_example", // String |
unpublished: true, // Boolean |
sortBy: "'created'", // String | Field to sort by
sortOrder: "'desc'", // String | Sort order (asc for ascending, desc for descending)
};
apiInstance.getFirmwareInfo(projectOrProductUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| product | String | [optional] | |
| firmwareType | String | [optional] | |
| version | String | [optional] | |
| target | String | [optional] | |
| filename | String | [optional] | |
| md5 | String | [optional] | |
| unpublished | Boolean | [optional] | |
| sortBy | String | Field to sort by | [optional] [default to 'created'] |
| sortOrder | String | Sort order (asc for ascending, desc for descending) | [optional] [default to 'desc'] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getFleet
Fleet getFleet(projectOrProductUID, fleetUID)
Get Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.getFleet(projectOrProductUID, fleetUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getFleetEnvironmentHierarchy
EnvTreeJsonNode getFleetEnvironmentHierarchy(projectOrProductUID, fleetUID)
Get environment variable hierarchy for a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.getFleetEnvironmentHierarchy(projectOrProductUID, fleetUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getFleetEnvironmentVariables
EnvironmentVariables getFleetEnvironmentVariables(projectOrProductUID, fleetUID)
Get environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.getFleetEnvironmentVariables(projectOrProductUID, fleetUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getFleets
GetDeviceFleets200Response getFleets(projectOrProductUID)
Get Project Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getFleets(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getNotefileSchemas
[NotefileSchema] getNotefileSchemas(projectOrProductUID)
Get variable format for a notefile
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getNotefileSchemas(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getProducts
GetProducts200Response getProducts(projectOrProductUID)
Get Products within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProducts(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getProject
Project getProject(projectOrProductUID)
Get a Project by ProjectUID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProject(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getProjectByProduct
Project getProjectByProduct(productUID)
Get a Project by ProductUID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let productUID = com.blues.airnote; // String |
apiInstance.getProjectByProduct(productUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| productUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getProjectEnvironmentHierarchy
EnvTreeJsonNode getProjectEnvironmentHierarchy(projectOrProductUID)
Get environment variable hierarchy for a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectEnvironmentHierarchy(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getProjectEnvironmentVariables
EnvironmentVariables getProjectEnvironmentVariables(projectOrProductUID)
Get environment variables of a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectEnvironmentVariables(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getProjectMembers
GetProjectMembers200Response getProjectMembers(projectOrProductUID)
Get Project Members
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectMembers(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getProjects
GetProjects200Response getProjects()
Get Projects accessible by the api_key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
apiInstance.getProjects().then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
This endpoint does not need any parameter.
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
performDfuAction
performDfuAction(projectOrProductUID, firmwareType, action, opts)
Update/cancel host or notecard firmware updates
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let action = "action_example"; // String |
let opts = {
deviceUID: ["null"], // [String] | A Device UID.
tag: ["null"], // [String] | Tag filter
serialNumber: ["null"], // [String] | Serial number filter
fleetUID: "fleetUID_example", // 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
dfuActionRequest: new NotehubJs.DfuActionRequest(), // DfuActionRequest | Which firmware in the case of an update action
};
apiInstance
.performDfuAction(projectOrProductUID, firmwareType, action, opts)
.then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| firmwareType | String | ||
| action | String | ||
| deviceUID | [String] | A Device UID. | [optional] |
| tag | [String] | Tag filter | [optional] |
| serialNumber | [String] | Serial number filter | [optional] |
| fleetUID | String | [optional] | |
| notecardFirmware | [String] | Firmware version filter | [optional] |
| location | [String] | Location filter | [optional] |
| hostFirmware | [String] | Host firmware filter | [optional] |
| productUID | [String] | [optional] | |
| sku | [String] | SKU filter | [optional] |
| dfuActionRequest | DfuActionRequest | Which firmware in the case of an update action | [optional] |
Return type
null (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
setFleetEnvironmentVariables
EnvironmentVariables setFleetEnvironmentVariables(projectOrProductUID, fleetUID, environmentVariables)
Set environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the fleet
apiInstance
.setFleetEnvironmentVariables(
projectOrProductUID,
fleetUID,
environmentVariables
)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String | ||
| environmentVariables | EnvironmentVariables | Environment variables to be added to the fleet |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
setGlobalEventTransformation
setGlobalEventTransformation(projectOrProductUID, body)
Set the project-level event JSONata transformation
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let body = { key: null }; // Object | JSONata expression which will be applied to each event before it is persisted and routed
apiInstance.setGlobalEventTransformation(projectOrProductUID, body).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| body | Object | JSONata expression which will be applied to each event before it is persisted and routed |
Return type
null (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
setProjectEnvironmentVariables
EnvironmentVariables setProjectEnvironmentVariables(projectOrProductUID, opts)
Set environment variables of a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
environmentVariables: new NotehubJs.EnvironmentVariables(), // EnvironmentVariables |
};
apiInstance.setProjectEnvironmentVariables(projectOrProductUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| environmentVariables | EnvironmentVariables | [optional] |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
updateFleet
Fleet updateFleet(projectOrProductUID, fleetUID, updateFleetRequest)
Update Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let updateFleetRequest = new NotehubJs.UpdateFleetRequest(); // UpdateFleetRequest | Fleet details to update
apiInstance.updateFleet(projectOrProductUID, fleetUID, updateFleetRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| fleetUID | String | ||
| updateFleetRequest | UpdateFleetRequest | Fleet details to update |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
uploadFirmware
FirmwareInfo uploadFirmware(projectOrProductUID, firmwareType, filename, body, opts)
Upload firmware binary
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let filename = "filename_example"; // String |
let body = "/path/to/file"; // File | contents of the firmware binary
let opts = {
version: "version_example", // String | Firmware version (optional). If not provided, the version will be extracted from firmware binary if available, otherwise left empty
notes: "notes_example", // String | Optional notes describing what's different about this firmware version
};
apiInstance
.uploadFirmware(projectOrProductUID, firmwareType, filename, body, opts)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| firmwareType | String | ||
| filename | String | ||
| body | File | contents of the firmware binary | |
| version | String | Firmware version (optional). If not provided, the version will be extracted from firmware binary if available, otherwise left empty | [optional] |
| notes | String | Optional notes describing what's different about this firmware version | [optional] |
Return type
HTTP request headers
- Content-Type: application/octet-stream
- Accept: application/json
Route API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| createRoute | POST /v1/projects/{projectOrProductUID}/routes | |
| deleteRoute | DELETE /v1/projects/{projectOrProductUID}/routes/{routeUID} | |
| getRoute | GET /v1/projects/{projectOrProductUID}/routes/{routeUID} | |
| getRouteLogsByRoute | GET /v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs | |
| getRoutes | GET /v1/projects/{projectOrProductUID}/routes | |
| updateRoute | PUT /v1/projects/{projectOrProductUID}/routes/{routeUID} |
createRoute
NotehubRoute createRoute(projectOrProductUID, notehubRoute)
Create Route within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let notehubRoute = {
http: {
disable_http_headers: false,
filter: {},
fleets: ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
http_headers: { "X-My-Header": "value" },
throttle_ms: 100,
timeout: 5000,
transform: {},
url: "https://example.com/ingest",
},
label: "Route Label",
}; // NotehubRoute | Route to be created
apiInstance.createRoute(projectOrProductUID, notehubRoute).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| notehubRoute | NotehubRoute | Route to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
deleteRoute
deleteRoute(projectOrProductUID, routeUID)
Delete single route within a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
apiInstance.deleteRoute(projectOrProductUID, routeUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| routeUID | String |
Return type
null (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getRoute
NotehubRoute getRoute(projectOrProductUID, routeUID)
Get single route within a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
apiInstance.getRoute(projectOrProductUID, routeUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| routeUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getRouteLogsByRoute
[RouteLog] getRouteLogsByRoute(projectOrProductUID, routeUID, opts)
Get Route Logs by Route UID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
deviceUID: ["null"], // [String] | A Device UID.
sortBy: "'date'", // String |
sortOrder: "'desc'", // String |
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
systemFilesOnly: true, // Boolean |
mostRecentOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
routingStatus: failure, // [String] |
responseStatus: 500, // [String] |
};
apiInstance.getRouteLogsByRoute(projectOrProductUID, routeUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| routeUID | String | ||
| pageSize | Number | [optional] [default to 50] | |
| pageNum | Number | [optional] [default to 1] | |
| deviceUID | [String] | A Device UID. | [optional] |
| sortBy | String | [optional] [default to 'date'] | |
| sortOrder | String | [optional] [default to 'desc'] | |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| systemFilesOnly | Boolean | [optional] | |
| mostRecentOnly | Boolean | [optional] | |
| files | String | [optional] | |
| routingStatus | [String] | [optional] | |
| responseStatus | [String] | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getRoutes
[NotehubRouteSummary] getRoutes(projectOrProductUID)
Get all Routes within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getRoutes(projectOrProductUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
updateRoute
NotehubRoute updateRoute(projectOrProductUID, routeUID, notehubRoute)
Update route by UID
Example
import * as NotehubJs from '@blues-inc/notehub-js';
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications['personalAccessToken'];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let notehubRoute = {
"http" {
"filter": {
"type": "include",
"system_notefiles": true,
"files": ["somefile.qo"],
},
"throttle_ms": 50,
"url": "http://new-route.url",
},
}
; // NotehubRoute | Route settings to be updated
apiInstance.updateRoute(projectOrProductUID, routeUID, notehubRoute).then((data) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, (error) => {
console.error(error);
});Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| routeUID | String | ||
| notehubRoute | NotehubRoute | Route settings to be updated |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
Usage API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| getDataUsage | GET /v1/projects/{projectOrProductUID}/usage/data | |
| getEventsUsage | GET /v1/projects/{projectOrProductUID}/usage/events | |
| getRouteLogsUsage | GET /v1/projects/{projectOrProductUID}/usage/route-logs | |
| getSessionsUsage | GET /v1/projects/{projectOrProductUID}/usage/sessions |
getDataUsage
GetDataUsage200Response getDataUsage(projectOrProductUID, period, opts)
Get data usage in bytes for a project with time range and period aggregation
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.UsageApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let period = "period_example"; // String | Period type for aggregation
let opts = {
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
deviceUID: ["null"], // [String] | A Device UID.
fleetUID: ["null"], // [String] | Filter by Fleet UID
limit: 200000, // Number | Limit the number of data points returned
aggregate: "'device'", // String | Aggregation level for results
};
apiInstance.getDataUsage(projectOrProductUID, period, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| period | String | Period type for aggregation | |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| deviceUID | [String] | A Device UID. | [optional] |
| fleetUID | [String] | Filter by Fleet UID | [optional] |
| limit | Number | Limit the number of data points returned | [optional] [default to 200000] |
| aggregate | String | Aggregation level for results | [optional] [default to 'device'] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getEventsUsage
UsageEventsResponse getEventsUsage(projectOrProductUID, period, opts)
Get events usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.UsageApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let period = "period_example"; // String | Period type for aggregation
let opts = {
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
deviceUID: ["null"], // [String] | A Device UID.
fleetUID: ["null"], // [String] | Filter by Fleet UID
limit: 200000, // Number | Limit the number of data points returned
aggregate: "'device'", // String | Aggregation level for results
notefile: ["null"], // [String] | Filter to specific notefiles
skipRecentData: false, // Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.
includeNotefiles: false, // Boolean | Include per-notefile event counts in the response
};
apiInstance.getEventsUsage(projectOrProductUID, period, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| period | String | Period type for aggregation | |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| deviceUID | [String] | A Device UID. | [optional] |
| fleetUID | [String] | Filter by Fleet UID | [optional] |
| limit | Number | Limit the number of data points returned | [optional] [default to 200000] |
| aggregate | String | Aggregation level for results | [optional] [default to 'device'] |
| notefile | [String] | Filter to specific notefiles | [optional] |
| skipRecentData | Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [optional] [default to false] |
| includeNotefiles | Boolean | Include per-notefile event counts in the response | [optional] [default to false] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getRouteLogsUsage
GetRouteLogsUsage200Response getRouteLogsUsage(projectOrProductUID, period, opts)
Get route logs usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.UsageApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let period = "period_example"; // String | Period type for aggregation
let opts = {
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
routeUID: ["null"], // [String] | A Route UID.
limit: 200000, // Number | Limit the number of data points returned
aggregate: "'route'", // String | Aggregation level for results
skipRecentData: false, // Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.
};
apiInstance.getRouteLogsUsage(projectOrProductUID, period, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| period | String | Period type for aggregation | |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| routeUID | [String] | A Route UID. | [optional] |
| limit | Number | Limit the number of data points returned | [optional] [default to 200000] |
| aggregate | String | Aggregation level for results | [optional] [default to 'route'] |
| skipRecentData | Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [optional] [default to false] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getSessionsUsage
GetSessionsUsage200Response getSessionsUsage(projectOrProductUID, period, opts)
Get sessions usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.UsageApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let period = "period_example"; // String | Period type for aggregation
let opts = {
startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
deviceUID: ["null"], // [String] | A Device UID.
fleetUID: ["null"], // [String] | Filter by Fleet UID
limit: 200000, // Number | Limit the number of data points returned
aggregate: "'device'", // String | Aggregation level for results
skipRecentData: false, // Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.
};
apiInstance.getSessionsUsage(projectOrProductUID, period, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectOrProductUID | String | ||
| period | String | Period type for aggregation | |
| startDate | Number | Start date for filtering results, specified as a Unix timestamp | [optional] |
| endDate | Number | End date for filtering results, specified as a Unix timestamp | [optional] |
| deviceUID | [String] | A Device UID. | [optional] |
| fleetUID | [String] | Filter by Fleet UID | [optional] |
| limit | Number | Limit the number of data points returned | [optional] [default to 200000] |
| aggregate | String | Aggregation level for results | [optional] [default to 'device'] |
| skipRecentData | Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [optional] [default to false] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json