Notehub JS Library Overview
The Notehub JS library is an npm library built specifically for use in JavaScript-based applications.
It is designed to get you connected to the Notehub API quickly, and allow you to access all the API routes relevant to interacting with Notehub in a JavaScript-friendly way.
Installation
You can install the Notehub JS library in any JavaScript-based application using the steps below.
In the root of the project where you wish to use Notehub JS, run the following command from the terminal.
Using npm:
npm install @blues-inc/notehub-js
Using yarn:
yarn add @blues-inc/notehub-js
Once the package is installed, you can import the library using import
or require
:
Using import
:
import * as NotehubJs from "@blues-inc/notehub-js";
const defaultClient = NotehubJs.ApiClient.instance;
Using import
to access the library in a TypeScript project currently will cause an
error because there is not yet a @types
file for it. To make the error disappear,
declare the module in a file with a .d.ts
extension.
declare module '@blues-inc/notehub-js';
Using require
:
const NotehubJs = require("@blues-inc/notehub-js");
const defaultClient = NotehubJs.ApiClient.instance;
Usage
Below is documentation and code examples for all the Notehub API methods.
There is one main type of authorization the Notehub API uses for nearly all requests:
API Key
The api_key
referenced in the following code examples is an API key (also known locally
as an X-Session-Token
).
The API key is an authentication token that can be obtained in two ways:
Manually cURL the token from the command line
Using the command line, a user can request a new token from the
Notehub API /auth/login
endpoint
using a Notehub username and password in the body of the request.
Use NotehubJs.AuthorizationApi login
Using the Notehub JS library, a user can programmatically call the Notehub API's /auth/login
endpoint
via the NotehubJs.AuthorizationApi's login()
method while supplying a Notehub username and
password in the loginRequest
object.
API Calls and Consumption Credits
Be aware that all Notehub API calls made using the Notehub JS library utilize your account's Consumption Credits (CCs). For more information, please consult our pricing page.
All URIs are relative to https://api.notefile.net
Async/Await Syntax
If you'd like to use async/await
syntax in any of the documented code examples below,
add the async
keyword to the outer function/mthod with the following implementation.
// add the async keyword to your outer function/method
// sample code above stays the same
try {
data = await apiInstance.getRoutes(projectUID);
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
} catch (error) {
console.error(error);
}
Real World Use Cases of Notehub JS Library
As this library gains adoptions, we'll continue to provide new links to repos where this library being used in real world projects.
Indoor Floor Level Tracker Project
If you'd like to see examples of this library being used in real-world applications, check out this indoor floor-level tracker project in the Blues App Accelerator repo on GitHub.
The files that deserve special attention are:
ServiceLocatorServer.ts
- this file makes the variety of services composing the backend logic of the application discoverable to each other. For DRY-er code, the Notehub JS library's instances were created and passed to the various services that would require them to fetch and update data via the Notehub API. An instance of the Notehub JS client is created viaconst notehubJsClient = NotehubJs.ApiClient.instance
, and passed to thegetDataProvider()
andgetAttributeStore()
services that will need to interact with the Notehub API to perform their duties.NotehubDataProvider.ts
- this file is responsible for fetching data from the Notehub API for the application to display. It calls the project API'sgetProjectFleetDevices()
andgetProjectEvents()
methods, and the fleet API'sgetFleetEnvironmentVariables()
method as well.NotehubAttributeStore.ts
- this file sends updates to the Notehub API from the application like updated device name or updated environment variables. It calls two of the environment variable API's methods:putDeviceEnvironmentVariables()
andputFleetEnvironmentVariables()
.
Method | HTTP request | Description |
---|---|---|
login | POST /auth/login |
This is the only Notehub API call that does not require some form of authentication token, and it is used to generate the token which can then be used for almost all subsequent API requests.
login
Gets a session token from the API from a username and password.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let apiInstance = new NotehubJs.AuthorizationApi();
let loginRequest = {"username":"name@example.com","password":"test-password"}; // LoginRequest |
apiInstance.login(loginRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
loginRequest | LoginRequest |
No authorization required
Billing Account API
Method | HTTP request | Description |
---|---|---|
getBillingAccounts | GET /v1/billing-accounts |
getBillingAccounts
Get Billing Accounts accessible by the api_key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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
Successful 200 getBillingAccounts response
Device API
Method | HTTP request | Description |
---|---|---|
deleteDeviceEnvironmentVariable | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables/{key} | |
deleteDeviceFleets | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/fleets | |
disableDevice | POST /v1/projects/{projectUID}/devices/{deviceUID}/disable | |
disableDeviceConnectivityAssurance | POST /v1/projects/{projectUID}/devices/{deviceUID}/disable-connectivity-assurance | |
enableDevice | POST /v1/projects/{projectUID}/devices/{deviceUID}/enable | |
enableDeviceConnectivityAssurance | POST /v1/projects/{projectUID}/devices/{deviceUID}/enable-connectivity-assurance | |
getDeviceEnvironmentVariables | GET /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables | |
getDeviceEnvironmentVariablesByPin | GET /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | |
getDeviceFleets | GET /v1/projects/{projectUID}/devices/{deviceUID}/fleets | |
getDeviceHealthLog | GET /v1/projects/{projectUID}/devices/{deviceUID}/health-log | |
getDeviceLatest | GET /v1/projects/{projectUID}/devices/{deviceUID}/latest | |
getDevicePublicKey | GET /v1/projects/{projectUID}/devices/{deviceUID}/public-key | |
getDeviceSessions | GET /v1/projects/{projectUID}/devices/{deviceUID}/sessions | |
handleNoteSignal | POST /v1/projects/{projectUID}/devices/{deviceUID}/signal | |
putDeviceEnvironmentVariables | PUT /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables | |
putDeviceEnvironmentVariablesByPin | PUT /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | |
putDeviceFleets | PUT /v1/projects/{projectUID}/devices/{deviceUID}/fleets |
deleteDeviceEnvironmentVariable
Delete environment variable of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance.deleteDeviceEnvironmentVariable(projectUID, deviceUID, key).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
key | String | The environment variable key to delete. |
Return type
Successful 200 deleteDeviceEnvironmentVariable response
deleteDeviceFleets
Remove Device from Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let deleteDeviceFleetsRequest = new NotehubJs.DeleteDeviceFleetsRequest(); // DeleteDeviceFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
apiInstance
.deleteDeviceFleets(projectUID, deviceUID, deleteDeviceFleetsRequest)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
deleteDeviceFleetsRequest | DeleteDeviceFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |
Return type
Successful 200 deleteDeviceFleets response
disableDevice
Disable Device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.disableDevice(projectUID, deviceUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 disableDevice response
disableDeviceConnectivityAssurance
Disable Connectivity Assurance
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.disableDeviceConnectivityAssurance(projectUID, deviceUID).then(() => {
console.log("API called successfully.");
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
null (empty response body)
enableDevice
Enable Device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.enableDevice(projectUID, deviceUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 enableDevice response
enableDeviceConnectivityAssurance
Enable Connectivity Assurance
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.enableDeviceConnectivityAssurance(projectUID, deviceUID).then(() => {
console.log("API called successfully.");
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
null (empty response body)
getDeviceEnvironmentVariables
Get environment variables of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceEnvironmentVariables(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 getDeviceEnvironmentVariables response
getDeviceEnvironmentVariablesByPin
Get environment variables of a device with device pin authorization
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: pin
let pin = defaultClient.authentications["pin"];
pin.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let productUID = "com.blues.airnote"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceEnvironmentVariablesByPin(productUID, deviceUID).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 |
pin
getDeviceFleets
Get Device Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceFleets(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 getDeviceFleets response
getDeviceHealthLog
Get Device Health Log
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceHealthLog(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 getDeviceHealthLog response
getDeviceLatest
Get Device Latest Events
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceLatest(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 getDeviceLatest response
getDevicePublicKey
Get Device Public Key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDevicePublicKey(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
getDeviceSessions
Get Device Sessions
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getDeviceSessions(projectUID, deviceUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] |
Return type
Successful 200 getDeviceSessions response
handleNoteSignal
Send a signal from Notehub to a Notecard.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let body = new NotehubJs.Body(); // Body | Body or payload of singnal to be sent to the device
apiInstance.handleNoteSignal(projectUID, deviceUID, body).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
body | Body | Body or payload of signal to be sent to the device |
putDeviceEnvironmentVariables
Put environment variables of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
.putDeviceEnvironmentVariables(projectUID, deviceUID, environmentVariables)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
Return type
Successful 200 putDeviceEnvironmentVariables response
putDeviceEnvironmentVariablesByPin
Put environment variables of a device with device pin authorization
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: pin
let pin = defaultClient.authentications["pin"];
pin.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let productUID = "com.blues.airnote"; // String |
let deviceUID = "deviceUID_example"; // String |
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
.putDeviceEnvironmentVariablesByPin(
productUID,
deviceUID,
environmentVariables
)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
producttUID | String | ||
deviceUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
pin
putDeviceFleets
Add Device to Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DeviceApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let putDeviceFleetsRequest = new NotehubJs.PutDeviceFleetsRequest(); // PutDeviceFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
apiInstance.putDeviceFleets(projectUID, deviceUID, putDeviceFleetsRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
putDeviceFleetsRequest | PutDeviceFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |
Return type
Successful 200 putDeviceFleets response
Devices API
Method | HTTP request | Description |
---|---|---|
deleteProjectDevice | DELETE /v1/projects/{projectUID}/devices/{deviceUID} | |
getDevice | GET /v1/projects/{projectUID}/devices/{deviceUID} | |
getProjectDevicePublicKeys | GET /v1/projects/{projectUID}/devices/public-keys | |
getProjectDevices | GET /v1/projects/{projectUID}/devices | |
getProjectFleetDevices | GET /v1/projects/{projectUID}/fleets/{fleetUID}/devices | |
postProvisionProjectDevice | POST /v1/projects/{projectUID}/devices/{deviceUID}/provision |
deleteProjectDevice
Delete Device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DevicesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let purge = "false"; // String |
apiInstance.deleteProjectDevice(projectUID, deviceUID, purge).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
purge | String | [default to 'false'] |
Return type
Successful 200 deleteProjectDevice response
getDevice
Get Device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DevicesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDevice(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 getDevice response
getProjectDevicePublicKeys
Get Device Public Keys of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DevicesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getProjectDevicePublicKeys(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] |
getProjectDevices
Get Devices of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DevicesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getProjectDevices(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] |
Return type
Successful 200 getProjectDevices response
getProjectFleetDevices
Get Devices of a Fleet within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DevicesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getProjectFleetDevices(projectUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] |
Return type
Successful 200 getProjectFleetDevices response
postProvisionProjectDevice
Provision Device for a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DevicesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let postProvisionProjectDeviceRequest = new NotehubJs.PostProvisionProjectDeviceRequest(); // PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID
apiInstance.postProvisionProjectDevice(projectUID, deviceUID, postProvisionProjectDeviceRequest).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
postProvisionProjectDeviceRequest | PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID |
Return type
Object
Environment Variables API
Method | HTTP request | Description |
---|---|---|
deleteDeviceEnvironmentVariable | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables/{key} | |
deleteFleetEnvironmentVariable | DELETE /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables/{key} | |
deleteProjectEnvironmentVariable | DELETE /v1/projects/{projectUID}/environment_variables/{key} | |
getDeviceEnvironmentVariables | GET /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables | |
getDeviceEnvironmentVariablesByPin | GET /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | |
getFleetEnvironmentVariables | GET /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables | |
getProjectEnvironmentVariables | GET /v1/projects/{projectUID}/environment_variables | |
putDeviceEnvironmentVariables | PUT /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables | |
putDeviceEnvironmentVariablesByPin | PUT /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | |
putFleetEnvironmentVariables | PUT /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables | |
putProjectEnvironmentVariables | PUT /v1/projects/{projectUID}/environment_variables |
deleteDeviceEnvironmentVariable
Delete environment variable of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance.deleteDeviceEnvironmentVariable(projectUID, deviceUID, key).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
key | String | The environment variable key to delete. |
Return type
Successful 200 deleteDeviceEnvironmentVariable response
deleteFleetEnvironmentVariable
Delete environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "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(projectUID, fleetUID, key).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
key | String | The environment variable key to delete. |
Return type
Successful 200 deleteFleetEnvironmentVariable response
deleteProjectEnvironmentVariable
Delete an environment variable of a project by key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance.deleteProjectEnvironmentVariable(projectUID, key).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
key | String | The environment variable key to delete. |
Return type
Successful 200 deleteProjectEnvironmentVariable response
getDeviceEnvironmentVariables
Get environment variables of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceEnvironmentVariables(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 getDeviceEnvironmentVariables response
getDeviceEnvironmentVariablesByPin
Get environment variables of a device with device pin authorization
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: pin
let pin = defaultClient.authentications["pin"];
pin.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let productUID = "com.blues.airnote"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceEnvironmentVariablesByPin(productUID, deviceUID).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 |
pin
getFleetEnvironmentVariables
Get environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.getFleetEnvironmentVariables(projectUID, fleetUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String |
Return type
Successful 200 getFleetEnvironmentVariables response
getProjectEnvironmentVariables
Get environment variables of a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectEnvironmentVariables(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
Successful 200 getProjectEnvironmentVariables response
putDeviceEnvironmentVariables
Put environment variables of a device
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
.putDeviceEnvironmentVariables(projectUID, deviceUID, environmentVariables)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
Return type
Successful 200 putDeviceEnvironmentVariables response
putDeviceEnvironmentVariablesByPin
Put environment variables of a device with device pin authorization
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: pin
let pin = defaultClient.authentications["pin"];
pin.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let productUID = "com.blues.airnote"; // String |
let deviceUID = "deviceUID_example"; // String |
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
.putDeviceEnvironmentVariablesByPin(
productUID,
deviceUID,
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 | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
pin
putFleetEnvironmentVariables
Put environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "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
.putFleetEnvironmentVariables(projectUID, fleetUID, environmentVariables)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the fleet |
Return type
Successful 200 putFleetEnvironmentVariables response
putProjectEnvironmentVariables
Put environment variables of a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EnvironmentVariablesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
environmentVariables: new NotehubJs.EnvironmentVariables(), // EnvironmentVariables |
};
apiInstance.putProjectEnvironmentVariables(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
environmentVariables | EnvironmentVariables | [optional] |
Return type
Successful 200 putProjectEnvironmentVariables response
Event API
Method | HTTP request | Description |
---|---|---|
getFleetEvents | GET /v1/projects/{projectUID}/fleets/{fleetUID}/events | |
getFleetEventsByCursor | GET /v1/projects/{projectUID}/fleets/{fleetUID}/events-cursor | |
getProjectEvents | GET /v1/projects/{projectUID}/events | |
getProjectEventsByCursor | GET /v1/projects/{projectUID}/events-cursor |
getFleetEvents
Get Events of a Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EventApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
deviceUIDs: ["null"], // [String] | A comma separated list of Device UIDs.
sortBy: "captured", // String |
sortOrder: "asc", // String |
startDate: 1628631763, // Number | Unix timestamp
endDate: 1657894210, // Number | Unix timestamp
};
apiInstance.getFleetEvents(projectUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] | |
deviceUIDs | [String] | A comma separated list of Device UIDs. | [optional] |
sortBy | String | [optional] [default to 'captured'] | |
sortOrder | String | [optional] [default to 'asc'] | |
startDate | Number | Unix timestamp | [optional] |
endDate | Number | Unix timestamp | [optional] |
Return type
Successful 200 getFleetEvents response
getFleetEventsByCursor
Get Events of a Fleet by cursor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EventApi();
let projectUID = "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 |
};
apiInstance.getFleetEventsByCursor(projectUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | 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'] |
Return type
Successful 200 getFleetEventsByCursor response
getProjectEvents
Get Events of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EventApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
deviceUIDs: ["null"], // [String] | A comma separated list of Device UIDs.
sortBy: "captured", // String |
sortOrder: "asc", // String |
startDate: 1628631763, // Number | Unix timestamp
endDate: 1657894210, // Number | Unix timestamp
};
apiInstance.getProjectEvents(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] | |
deviceUIDs | [String] | A comma separated list of Device UIDs. | [optional] |
sortBy | String | [optional] [default to 'captured'] | |
sortOrder | String | [optional] [default to 'asc'] | |
startDate | Number | Unix timestamp | [optional] |
endDate | Number | Unix timestamp | [optional] |
Return type
Successful 200 getProjectEvents response
getProjectEventsByCursor
Get Events of a Project by cursor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.EventApi();
let projectUID = "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 |
};
apiInstance.getProjectEventsByCursor(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | 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'] |
Return type
Successful 200 getProjectEventsByCursor response
Files API
Method | HTTP request | Description |
---|---|---|
handleNotefileChanges | GET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes | |
handleNotefileChangesPending | GET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes/pending | |
handleNotefileDelete | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/files |
handleNotefileChanges
Used to perform queries on a single or multiple files to determine if new Notes are available to read
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FilesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let opts = {
tracker: "tracker_example", // String | The change tracker ID.
files: ["null"], // [String] | One or more files to obtain change information from.
};
apiInstance.handleNotefileChanges(projectUID, deviceUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
tracker | String | The change tracker ID. | [optional] |
files | [String] | One or more files to obtain change information from. | [optional] |
Return type
Successful 200 handleNotefileChanges response
handleNotefileChangesPending
Returns info about file changes that are pending upload to Notehub or download to the Notecard.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FilesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.handleNotefileChangesPending(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 handleNotefileChangesPending response
handleNotefileDelete
Deletes Notefiles and the Notes they contain.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FilesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let handleNotefileDeleteRequest = new NotehubJs.HandleNotefileDeleteRequest(); // HandleNotefileDeleteRequest |
apiInstance
.handleNotefileDelete(projectUID, deviceUID, handleNotefileDeleteRequest)
.then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
handleNotefileDeleteRequest | HandleNotefileDeleteRequest |
Return type
Successful 200 handleNotefileDelete response
Fleet API
Method | HTTP request | Description |
---|---|---|
createFleet | POST /v1/projects/{projectUID}/fleets | |
deleteDeviceFleets | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/fleets | |
deleteFleet | DELETE /v1/projects/{projectUID}/fleets/{fleetUID} | |
deleteFleetEnvironmentVariable | DELETE /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables/{key} | |
getDeviceFleets | GET /v1/projects/{projectUID}/devices/{deviceUID}/fleets | |
getFleetEnvironmentVariables | GET /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables | |
getFleetEvents | GET /v1/projects/{projectUID}/fleets/{fleetUID}/events | |
getFleetEventsByCursor | GET /v1/projects/{projectUID}/fleets/{fleetUID}/events-cursor | |
getProjectFleetDevices | GET /v1/projects/{projectUID}/fleets/{fleetUID}/devices | |
getProjectFleets | GET /v1/projects/{projectUID}/fleets | |
putDeviceFleets | PUT /v1/projects/{projectUID}/devices/{deviceUID}/fleets | |
putFleetEnvironmentVariables | PUT /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables | |
updateFleet | PUT /v1/projects/{projectUID}/fleets/{fleetUID} |
createFleet
Create Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createFleetRequest = new NotehubJs.CreateFleetRequest(); // CreateFleetRequest | Fleet to be added
apiInstance.createFleet(projectUID, createFleetRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
createFleetRequest | CreateFleetRequest | Fleet to be added |
Return type
Successful 200 createFleet response
deleteDeviceFleets
Remove Device from Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let deleteDeviceFleetsRequest = new NotehubJs.DeleteDeviceFleetsRequest(); // DeleteDeviceFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
apiInstance
.deleteDeviceFleets(projectUID, deviceUID, deleteDeviceFleetsRequest)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
deleteDeviceFleetsRequest | DeleteDeviceFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |
Return type
Successful 200 deleteDeviceFleets response
deleteFleet
Delete Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.deleteFleet(projectUID, fleetUID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String |
Return type
Successful 200 deleteFleet response
deleteFleetEnvironmentVariable
Delete environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "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(projectUID, fleetUID, key).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
key | String | The environment variable key to delete. |
Return type
Successful 200 deleteFleetEnvironmentVariable response
getDeviceFleets
Get Device Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
apiInstance.getDeviceFleets(projectUID, deviceUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Return type
Successful 200 getDeviceFleets response
getFleetEnvironmentVariables
Get environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.getFleetEnvironmentVariables(projectUID, fleetUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String |
Return type
Successful 200 getFleetEnvironmentVariables response
getFleetEvents
Get Events of a Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
deviceUIDs: ["null"], // [String] | A comma separated list of Device UIDs.
sortBy: "captured", // String |
sortOrder: "asc", // String |
startDate: 1628631763, // Number | Unix timestamp
endDate: 1657894210, // Number | Unix timestamp
};
apiInstance.getFleetEvents(projectUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] | |
deviceUIDs | [String] | A comma separated list of Device UIDs. | [optional] |
sortBy | String | [optional] [default to 'captured'] | |
sortOrder | String | [optional] [default to 'asc'] | |
startDate | Number | Unix timestamp | [optional] |
endDate | Number | Unix timestamp | [optional] |
Return type
Successful 200 getFleetEvents response
getFleetEventsByCursor
Get Events of a Fleet by cursor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "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 |
};
apiInstance.getFleetEventsByCursor(projectUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | 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'] |
Return type
Successful 200 getFleetEventsByCursor response
getProjectFleetDevices
Get Devices of a Fleet within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getProjectFleetDevices(projectUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] |
Return type
Successful 200 getProjectFleetDevices response
getProjectFleets
Get Project Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectFleets(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
Successful 200 getProjectFleets response
putDeviceFleets
Add Device to Fleets
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let putDeviceFleetsRequest = new NotehubJs.PutDeviceFleetsRequest(); // PutDeviceFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
apiInstance.putDeviceFleets(projectUID, deviceUID, putDeviceFleetsRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
putDeviceFleetsRequest | PutDeviceFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |
Return type
Successful 200 putDeviceFleets response
putFleetEnvironmentVariables
Put environment variables of a fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "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
.putFleetEnvironmentVariables(projectUID, fleetUID, environmentVariables)
.then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the fleet |
Return type
Successful 200 putFleetEnvironmentVariables response
updateFleet
Update Fleet
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.FleetApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let updateFleetRequest = new NotehubJs.UpdateFleetRequest(); // UpdateFleetRequest | Fleet details to update
apiInstance.updateFleet(projectUID, fleetUID, updateFleetRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
updateFleetRequest | UpdateFleetRequest | Fleet details to update |
Return type
Successful 200 updateFleet response
Notes API
Method | HTTP request | Description |
---|---|---|
handleNoteAdd | POST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID} | |
handleNoteChanges | GET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/changes | |
handleNoteCreateAdd | POST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
handleNoteDelete | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
handleNoteGet | GET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
handleNoteUpdate | PUT /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} |
The note
requests enable the quick creation and management of Notes in Notefiles.
handleNoteAdd
Adds a Note to a Notefile.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.NotesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let note = new NotehubJs.Note(); // Note | Body or payload of note to be added to the device
apiInstance.handleNoteAdd(projectUID, deviceUID, notefileID, note).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
notefileID | String | ||
note | Note | Body or payload of note to be added to the device |
Return type
Successful 200 handleNoteAdd response
handleNoteChanges
Incrementally retrieve changes within a specific Notefile.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.NotesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let opts = {
tracker: "tracker_example", // String | The change tracker ID.
max: 56, // Number | The maximum number of Notes to return in the request.
start: true, // Boolean | true to reset the tracker to the beginning.
stop: true, // Boolean | true to delete the tracker.
deleted: true, // Boolean | true to return deleted notes.
_delete: true, // Boolean | true to delete the notes returned by the request.
};
apiInstance.handleNoteChanges(projectUID, deviceUID, notefileID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
notefileID | String | ||
tracker | String | The change tracker ID. | [optional] |
max | Number | The maximum number of Notes to return in the request. | [optional] |
start | Boolean | true to reset the tracker to the beginning. | [optional] |
stop | Boolean | true to delete the tracker. | [optional] |
deleted | Boolean | true to return deleted notes. | [optional] |
_delete | Boolean | true to delete the notes returned by the request. | [optional] |
Return type
Successful 200 handleNoteChanges response
handleNoteCreateAdd
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;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.NotesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let note = new NotehubJs.Note(); // Note | Body or payload of note to be added to the device
apiInstance
.handleNoteCreateAdd(projectUID, deviceUID, notefileID, noteID, note)
.then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
notefileID | String | ||
noteID | String | ||
note | Note | Body or payload of note to be added to the device |
Return type
Successful 200 handleNoteCreateAdd response
handleNoteDelete
Delete a note from a DB notefile
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.NotesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
apiInstance.handleNoteDelete(projectUID, deviceUID, notefileID, noteID).then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Return type
Successful 200 handleNoteDelete response
handleNoteGet
Get a note from a DB notefile
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.NotesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let opts = {
_delete: true, // Boolean | Whether to delete the note from the DB notefile
deleted: true, // Boolean | Whether to return deleted notes
};
apiInstance.handleNoteGet(projectUID, deviceUID, notefileID, noteID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | 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
Successful 200 handleNoteGet response
handleNoteUpdate
Update a note in a DB notefile
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.NotesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let note = new NotehubJs.Note(); // Note | Body or payload of note to be added to the device
apiInstance
.handleNoteUpdate(projectUID, deviceUID, notefileID, noteID, note)
.then(
() => {
console.log("API called successfully.");
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
notefileID | String | ||
noteID | String | ||
note | Note | Body or payload of note to be added to the device |
Return type
Successful 200 handleNoteUpdate response
Product API
Method | HTTP request | Description |
---|---|---|
createProduct | POST /v1/projects/{projectUID}/products | |
getProjectByProduct | GET /v1/products/{productUID}/project | |
getProjectProducts | GET /v1/projects/{projectUID}/products |
createProduct
Create Product within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProductApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createProductRequest = new NotehubJs.CreateProductRequest(); // CreateProductRequest | Product to be created
apiInstance.createProduct(projectUID, createProductRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
createProductRequest | CreateProductRequest | Product to be created |
Return type
Successful 200 createProduct response
getProjectByProduct
Get a Project by ProductUID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProductApi();
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
Successful 200 getProjectByProduct response
getProjectProducts
Get Products within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProductApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectProducts(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
Successful 200 getProjectProducts response
Project API
Method | HTTP request | Description |
---|---|---|
cloneProject | POST /v1/projects/{projectUID}/clone | |
createProduct | POST /v1/projects/{projectUID}/products | |
createProject | POST /v1/projects | |
deleteProjectEnvironmentVariable | DELETE /v1/projects/{projectUID}/environment_variables/{key} | |
disableGlobalTransformation | POST /v1/projects/{projectUID}/global-transformation/disable | |
enableGlobalTransformation | POST /v1/projects/{projectUID}/global-transformation/enable | |
getProject | GET /v1/projects/{projectUID} | |
getProjectByProduct | GET /v1/products/{productUID}/project | |
getProjectDevicePublicKeys | GET /v1/projects/{projectUID}/devices/public-keys | |
getProjectDevices | GET /v1/projects/{projectUID}/devices | |
getProjectEnvironmentVariables | GET /v1/projects/{projectUID}/environment_variables | |
getProjectEvents | GET /v1/projects/{projectUID}/events | |
getProjectEventsByCursor | GET /v1/projects/{projectUID}/events-cursor | |
getProjectFleetDevices | GET /v1/projects/{projectUID}/fleets/{fleetUID}/devices | |
getProjectMembers | GET /v1/projects/{projectUID}/members | |
getProjectProducts | GET /v1/projects/{projectUID}/products | |
getProjects | GET /v1/projects | |
postProvisionProjectDevice | POST /v1/projects/{projectUID}/devices/{deviceUID}/provision | |
putProjectEnvironmentVariables | PUT /v1/projects/{projectUID}/environment_variables | |
setGlobalTransformation | POST /v1/projects/{projectUID}/global-transformation |
cloneProject
Clone a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String | The project UID to be cloned.
let cloneProjectRequest = new NotehubJs.CloneProjectRequest(); // CloneProjectRequest | Project to be cloned
apiInstance.cloneProject(projectUID, cloneProjectRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | The project UID to be cloned. | |
cloneProjectRequest | CloneProjectRequest | Project to be cloned |
Return type
Successful 200 cloneProject response
createProduct
Create Product within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createProductRequest = new NotehubJs.CreateProductRequest(); // CreateProductRequest | Product to be created
apiInstance.createProduct(projectUID, createProductRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
createProductRequest | CreateProductRequest | Product to be created |
Return type
Successful 200 createProduct response
createProject
Create a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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
Successful 200 createProject response
deleteProjectEnvironmentVariable
Delete an environment variable of a project by key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance.deleteProjectEnvironmentVariable(projectUID, key).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
key | String | The environment variable key to delete. |
Return type
Successful 200 deleteProjectEnvironmentVariable response
disableGlobalTransformation
Disable the project-level event JSONata transformation
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.disableGlobalTransformation(projectUID).then(() => {
console.log("API called successfully.");
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
null (empty response body)
enableGlobalTransformation
Enable the project-level event JSONata transformation
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.enableGlobalTransformation(projectUID).then(() => {
console.log("API called successfully.");
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
null (empty response body)
getProject
Get a Project by ProjectUID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProject(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
Successful 200 getProject response
getProjectByProduct
Get a Project by ProductUID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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
Successful 200 getProjectByProduct response
getProjectDevicePublicKeys
Get Device Public Keys of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getProjectDevicePublicKeys(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] |
getProjectDevices
Get Devices of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getProjectDevices(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] |
Return type
Successful 200 getProjectDevices response
getProjectEnvironmentVariables
Get environment variables of a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectEnvironmentVariables(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
Successful 200 getProjectEnvironmentVariables response
getProjectEvents
Get Events of a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
deviceUIDs: ["null"], // [String] | A comma separated list of Device UIDs.
sortBy: "'captured'", // String |
sortOrder: "'asc'", // String |
startDate: 1628631763, // Number | Unix timestamp
endDate: 1657894210, // Number | Unix timestamp
};
apiInstance.getProjectEvents(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] | |
deviceUIDs | [String] | A comma separated list of Device UIDs. | [optional] |
sortBy | String | [optional] [default to 'captured'] | |
sortOrder | String | [optional] [default to 'asc'] | |
startDate | Number | Unix timestamp | [optional] |
endDate | Number | Unix timestamp | [optional] |
Return type
Successful 200 getProjectEvents response
getProjectEventsByCursor
Get Events of a Project by cursor
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "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 |
};
apiInstance.getProjectEventsByCursor(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | 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'] |
Return type
Successful 200 getProjectEvents response
getProjectFleetDevices
Get Devices of a Fleet within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
};
apiInstance.getProjectFleetDevices(projectUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
pageSize | Number | [optional] [default to 50] | |
pageNum | Number | [optional] [default to 1] |
Return type
Successful 200 getProjectFleetDevices response
getProjectMembers
Get Project Members
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectMembers(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
Successful 200 getProjectMembers response
getProjectProducts
Get Products within a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectProducts(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
Successful 200 getProjectProducts response
getProjects
Get Projects accessible by the api_key
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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
Successful 200 getProjects response
postProvisionProjectDevice
Provision Device for a Project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.DevicesApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "deviceUID_example"; // String |
let postProvisionProjectDeviceRequest = new NotehubJs.PostProvisionProjectDeviceRequest(); // PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID
apiInstance.postProvisionProjectDevice(projectUID, deviceUID, postProvisionProjectDeviceRequest).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
postProvisionProjectDeviceRequest | PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID |
Return type
null (empty response body)
putProjectEnvironmentVariables
Put environment variables of a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
environmentVariables: new NotehubJs.EnvironmentVariables(), // EnvironmentVariables |
};
apiInstance.putProjectEnvironmentVariables(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
environmentVariables | EnvironmentVariables | [optional] |
Return type
Successful 200 putProjectEnvironmentVariables response
setGlobalTransformation
Set the project-level event JSONata transformation
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "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.setGlobalTransformation(projectUID, body).then(() => {
console.log("API called successfully.");
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
body | Object | JSONata expression which will be applied to each event before it is persisted and routed |
Return type
null (empty response body)
Route API
Method | HTTP request | Description |
---|---|---|
createRoute | POST /v1/projects/{projectUID}/routes | |
deleteRoute | DELETE /v1/projects/{projectUID}/routes/{routeUID} | |
getRoute | GET /v1/projects/{projectUID}/routes/{routeUID} | |
getRoutes | GET /v1/projects/{projectUID}/routes | |
updateRoute | PUT /v1/projects/{projectUID}/routes/{routeUID} |
createRoute
Create Route within a Project.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let route = {
label: "Route Label",
type: "http",
http: {
fleets: ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
throttle_ms: 100,
url: "http://route.url",
},
}; // Route | Route to be Created
apiInstance.createRoute(projectUID, route).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
route | Route Route to be Created |
Return type
Successful 200 createRoute response
deleteRoute
Delete single route within a project
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
let apiInstance = new NotehubJs.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = route:cbd20093cba58392c9f9bbdd0cdeb1a0; // String |
apiInstance.deleteRoute(projectUID, routeUID).then((data) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
routeUID | String |
Return type
Successful 200 deleteRoute response
getRoute
Get single route within a project.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
let apiInstance = new NotehubJs.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = route:cbd20093cba58392c9f9bbdd0cdeb1a0; // String |
apiInstance.getRoute(projectUID, routeUID).then((data) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
routeUID | String |
Return type
Successful 200 getRoute response
getRoutes
Get all Routes within a Project.
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getRoutes(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Return type
Successful 200 getRoutes response
updateRoute
Update route by UID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let route = {
http: {
filter: { type: "include", system_notefiles: true, files: ["somefile.qo"] },
throttle_ms: 50,
url: "http://new-route.url",
},
}; // Route | Route settings to be updated
apiInstance.updateRoute(projectUID, routeUID, route).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
routeUID | String | ||
route | Route | Route settings to be updated |
Return type
Successful 200 updateRoute response
Route Logs API
Method | HTTP request | Description |
---|---|---|
getRouteLogsByEvent | GET /v1/projects/{projectUID}/events/{eventUID}/route-logs | |
getRouteLogsByRoute | GET /v1/projects/{projectUID}/routes/{routeUID}/route-logs |
getRouteLogsByEvent
Get Route Logs by Event UID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.RouteLogsApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let eventUID = "4506f411-dea6-44a0-9743-1130f57d7747"; // String |
apiInstance.getRouteLogsByEvent(projectUID, eventUID).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
eventUID | String |
Return type
Successful 200 getRouteLogsByEvent response
getRouteLogsByRoute
Get Route Logs by Route UID
Example
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.RouteLogsApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let opts = {
"pageSize": 50, // Number |
"pageNum": 1, // Number |
"deviceUID": "deviceUID_example", // String | A Device UID.
"sortBy": "'captured'", // String |
"sortOrder": "'asc'", // String |
"startDate": 1628631763, // Number | Unix timestamp
"endDate": 1657894210, // Number | Unix timestamp
"systemFilesOnly": true, // Boolean |
"files": "_health.qo, data.qo" // String |
};
apiInstance.getRouteLogsByRoute(projectUID, routeUID, opts).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
projectUID | 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 'captured'] | |
sortOrder | String | [optional] [default to 'asc'] | |
startDate | Nu |