Rate this page Â
- ★★
- ★★
- ★★
- ★★
- ★★
Can we improve this page? Send us feedbackRate this page
- ★★
- ★★
- ★★
- ★★
- ★★
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.
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;
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:
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.
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
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); }
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 via const notehubJsClient = NotehubJs.ApiClient.instance
, and passed to the getDataProvider()
and getAttributeStore()
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's getProjectFleetDevices()
and getProjectEvents()
methods, and the fleet API's getFleetEnvironmentVariables()
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()
and putFleetEnvironmentVariables()
.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.
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); } );
Name | Type | Description | Notes |
---|---|---|---|
loginRequest | LoginRequest |
No authorization required
Method | HTTP request | Description |
---|---|---|
getBillingAccounts | GET /v1/billing-accounts |
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); } );
This endpoint does not need any parameter.
Successful 200 getBillingAccounts response
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 | |
enableDevice | POST /v1/projects/{projectUID}/devices/{deviceUID}/enable | |
getDeviceEnvironmentVariables | GET /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables | |
getDeviceEnvironmentVariablesByPin | GET /v1/projects/{projectUID}/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/projects/{projectUID}/devices/{deviceUID}/environment_variables_with_pin | |
putDeviceFleets | PUT /v1/projects/{projectUID}/devices/{deviceUID}/fleets |
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
key | String | The environment variable key to delete. |
Successful 200 deleteDeviceEnvironmentVariable response
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); } );
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. |
Successful 200 deleteDeviceFleets response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 disableDevice response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 enableDevice response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 getDeviceEnvironmentVariables response
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 projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String | let deviceUID = "deviceUID_example"; // String | apiInstance.getDeviceEnvironmentVariablesByPin(projectUID, deviceUID).then( (data) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); }, (error) => { console.error(error); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
pin
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 getDeviceFleets response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 getDeviceHealthLog response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 getDeviceLatest response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
pageSize | Number | [optional][default to 50] | |
pageNum | Number | [optional][default to 1] |
Successful 200 getDeviceSessions response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
body | Body | Body or payload of signal to be sent to the device |
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
Successful 200 putDeviceEnvironmentVariables response
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 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 .putDeviceEnvironmentVariablesByPin( projectUID, deviceUID, environmentVariables ) .then( (data) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); }, (error) => { console.error(error); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
pin
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); } );
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. |
Successful 200 putDeviceFleets response
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 |
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
purge | String | [default to 'false'] |
Successful 200 deleteProjectDevice response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 getDevice response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional][default to 50] | |
pageNum | Number | [optional][default to 1] |
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional][default to 50] | |
pageNum | Number | [optional][default to 1] |
Successful 200 getProjectDevices response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
pageSize | Number | [optional][default to 50] | |
pageNum | Number | [optional][default to 1] |
Successful 200 getProjectFleetDevices response
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/projects/{projectUID}/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/projects/{projectUID}/devices/{deviceUID}/environment_variables_with_pin | |
putFleetEnvironmentVariables | PUT /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables | |
putProjectEnvironmentVariables | PUT /v1/projects/{projectUID}/environment_variables |
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
key | String | The environment variable key to delete. |
Successful 200 deleteDeviceEnvironmentVariable response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
key | String | The environment variable key to delete. |
Successful 200 deleteFleetEnvironmentVariable response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
key | String | The environment variable key to delete. |
Successful 200 deleteProjectEnvironmentVariable response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 getDeviceEnvironmentVariables response
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 projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String | let deviceUID = "deviceUID_example"; // String | apiInstance.getDeviceEnvironmentVariablesByPin(projectUID, deviceUID).then( (data) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); }, (error) => { console.error(error); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
pin
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String |
Successful 200 getFleetEnvironmentVariables response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Successful 200 getProjectEnvironmentVariables response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
Successful 200 putDeviceEnvironmentVariables response
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 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 .putDeviceEnvironmentVariablesByPin( projectUID, deviceUID, environmentVariables ) .then( (data) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); }, (error) => { console.error(error); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the device |
pin
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the fleet |
Successful 200 putFleetEnvironmentVariables response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
environmentVariables | EnvironmentVariables | [optional] |
Successful 200 putProjectEnvironmentVariables response
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 |
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); } );
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] |
Successful 200 getFleetEvents response
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); } );
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'] |
Successful 200 getFleetEventsByCursor response
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); } );
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] |
Successful 200 getProjectEvents response
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); } );
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'] |
Successful 200 getProjectEventsByCursor response
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 |
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); } );
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] |
Successful 200 handleNotefileChanges response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 handleNotefileChangesPending response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
handleNotefileDeleteRequest | HandleNotefileDeleteRequest |
Successful 200 handleNotefileDelete response
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} |
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
createFleetRequest | CreateFleetRequest | Fleet to be added |
Successful 200 createFleet response
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); } );
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. |
Successful 200 deleteDeviceFleets response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String |
Successful 200 deleteFleet response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
key | String | The environment variable key to delete. |
Successful 200 deleteFleetEnvironmentVariable response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String |
Successful 200 getDeviceFleets response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String |
Successful 200 getFleetEnvironmentVariables response
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); } );
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] |
Successful 200 getFleetEvents response
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); } );
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'] |
Successful 200 getFleetEventsByCursor response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
pageSize | Number | [optional][default to 50] | |
pageNum | Number | [optional][default to 1] |
Successful 200 getProjectFleetDevices response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Successful 200 getProjectFleets response
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); } );
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. |
Successful 200 putDeviceFleets response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
environmentVariables | EnvironmentVariables | Environment variables to be added to the fleet |
Successful 200 putFleetEnvironmentVariables response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
updateFleetRequest | UpdateFleetRequest | Fleet details to update |
Successful 200 updateFleet response
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.
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
notefileID | String | ||
note | Note | Body or payload of note to be added to the device |
Successful 200 handleNoteAdd response
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); } );
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] |
Successful 200 handleNoteChanges response
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); } );
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 |
Successful 200 handleNoteCreateAdd response
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); } );
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
deviceUID | String | ||
notefileID | String | ||
noteID | String |
Successful 200 handleNoteDelete response
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); } );
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] |
Successful 200 handleNoteGet response
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); } );
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 |
Successful 200 handleNoteUpdate response
Method | HTTP request | Description |
---|---|---|
createProduct | POST /v1/projects/{projectUID}/products | |
getProjectByProduct | GET /v1/products/{productUID}/project | |
getProjectProducts | GET /v1/projects/{projectUID}/products |
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
createProductRequest | CreateProductRequest | Product to be created |
Successful 200 createProduct response
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); });
Name | Type | Description | Notes |
---|---|---|---|
productUID | String |
Successful 200 getProjectByProduct response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Successful 200 getProjectProducts response
Method | HTTP request | Description |
---|---|---|
createProduct | POST /v1/projects/{projectUID}/products | |
createProject | POST /v1/projects | |
deleteProjectEnvironmentVariable | DELETE /v1/projects/{projectUID}/environment_variables/{key} | |
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 | |
putProjectEnvironmentVariables | PUT /v1/projects/{projectUID}/environment_variables |
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
createProductRequest | CreateProductRequest | Product to be created |
Successful 200 createProduct response
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); });
Name | Type | Description | Notes |
---|---|---|---|
createProjectRequest | CreateProjectRequest | Project to be created |
Successful 200 createProject response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
key | String | The environment variable key to delete. |
Successful 200 deleteProjectEnvironmentVariable response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Successful 200 getProject response
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); });
Name | Type | Description | Notes |
---|---|---|---|
productUID | String |
Successful 200 getProjectByProduct response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional][default to 50] | |
pageNum | Number | [optional][default to 1] |
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
pageSize | Number | [optional][default to 50] | |
pageNum | Number | [optional][default to 1] |
Successful 200 getProjectDevices response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Successful 200 getProjectEnvironmentVariables response
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); });
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] |
Successful 200 getProjectEvents response
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); });
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'] |
Successful 200 getProjectEvents response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
fleetUID | String | ||
pageSize | Number | [optional][default to 50] | |
pageNum | Number | [optional][default to 1] |
Successful 200 getProjectFleetDevices response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Successful 200 getProjectMembers response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Successful 200 getProjectProducts response
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); });
This endpoint does not need any parameter.
Successful 200 getProjects response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
environmentVariables | EnvironmentVariables | [optional] |
Successful 200 putProjectEnvironmentVariables response
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} |
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
route | Route Route to be Created |
Successful 200 createRoute response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
routeUID | String |
Successful 200 deleteRoute response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
routeUID | String |
Successful 200 getRoute response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String |
Successful 200 getRoutes response
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); });
Name | Type | Description | Notes |
---|---|---|---|
projectUID | String | ||
routeUID | String | ||
route | Route | Route settings to be updated |
Successful 200 updateRoute response