Project API
The Notehub project API provides RESTful methods that can be used to GET
and
POST
project data.
Name | HTTP Request |
---|---|
Get Projects | GET /v1/projects |
Get Project | GET /v1/projects/{projectUID} |
Get Project by Product | GET /v1/products/{productUID}/project |
Create Project | POST /v1/projects |
Delete Project | DELETE /v1/projects/{projectUID} |
Clone Project | POST /v1/projects/{projectUID}/clone |
Get Project Members | GET /v1/projects/{projectUID}/members |
Create Product | POST /v1/projects/{projectUID}/products |
Get Products | GET /v1/projects/{projectUID}/products |
Get Project Environment Variables | GET /v1/projects/{projectUID}/environment_variables |
Delete Project Environment Variable | DELETE /v1/projects/{projectUID}/environment_variables/{key} |
Set Project Environment Variables | PUT /v1/projects/{projectUID}/environment_variables |
Get Fleet Environment Variables | GET /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables |
Delete Fleet Environment Variable | DELETE /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables/{key} |
Set Fleet Environment Variables | PUT /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables |
Get Fleets | GET /v1/projects/{projectUID}/fleets |
Create Fleet | POST /v1/projects/{projectUID}/fleets |
Update Fleet | PUT /v1/projects/{projectUID}/fleets/{fleetUID} |
Delete Fleet | DELETE /v1/projects/{projectUID}/fleets/{fleetUID} |
Get Device Fleets | GET /v1/projects/{projectUID}/devices/{deviceUID}/fleets |
Add Device to Fleets | PUT /v1/projects/{projectUID}/devices/{deviceUID}/fleets |
Remove Device from Fleets | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/fleets |
Set Global JSONata Transform | POST /v1/projects/{projectUID}/global-transformation |
Enable Global JSONata Transform | POST /v1/projects/{projectUID}/global-transformation/enable |
Disable Global JSONata Transform | POST /v1/projects/{projectUID}/global-transformation/disable |
Get Available Firmware | GET /v1/projects/{projectUID}/firmware |
Update Firmware | POST /v1/projects/{projectUID}/ota/update |
Get Firmware Update Status | GET /v1/projects/{projectUID}/ota/status |
Get Projects Notehub
Get all Notehub projects accessible by provided authentication token.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects |
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
apiInstance.getProjects().then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
import notehub_py
from notehub_py.models.get_projects200_response import GetProjects200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
try:
api_response = api_instance.get_projects()
print("The response of ProjectApi->get_projects:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_projects: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the project.
label
string
The user-assigned label for the project.
created
string
The date and time the project was created in Notehub.
administrative_contact
object
Contact information for the administrative contact assigned in Notehub.
technical_contact
object
Contact information for the technical contact assigned in Notehub.
role
string
The role of the project member creating the API request.
{
"projects": [
{
"uid": "app:00000000-0000-0000-0000-000000000000",
"label": "First Notehub Project",
"created": "2021-04-26T19:11:05Z",
"administrative_contact": {
"name": "John Doe",
"email": "someone@example.com",
"role": "Admin",
"organization": "Blues"
},
"technical_contact": {
"name": "Jane Doe",
"email": "someone@example.com",
"role": "Tech",
"organization": "Blues"
},
"role": "owner"
},
{
"uid": "app:00000000-0000-0000-0000-000000000000",
"label": "Second Notehub Project",
"created": "2022-07-26T19:11:05Z",
"administrative_contact": {
"name": "Jane Doe",
"email": "someone@example.com",
"role": "Admin",
"organization": "Blues"
},
"technical_contact": {
"name": "John Doe",
"email": "someone@example.com",
"role": "Tech",
"organization": "Blues"
},
"role": "owner"
}
]
}
Get Project Notehub
Get information about a Notehub project by ProjectUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID} |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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);
}
);
import notehub_py
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project(project_uid)
print("The response of ProjectApi->get_project:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the project.
label
string
The user-assigned label for the project.
created
string
The date and time the project was created in Notehub.
administrative_contact
object
Contact information for the administrative contact assigned in Notehub.
technical_contact
object
Contact information for the technical contact assigned in Notehub.
role
string
The role of the project member creating the API request.
{
"uid": "app:00000000-0000-0000-0000-000000000000",
"label": "My Notehub Project",
"created": "2021-04-26T19:11:05Z",
"administrative_contact": {
"name": "John Doe",
"email": "someone@example.com",
"role": "Admin",
"organization": "Blues"
},
"technical_contact": {
"name": "Jane Doe",
"email": "someone@example.com",
"role": "Tech",
"organization": "Blues"
},
"role": "owner"
}
Get Project by Product Notehub
Get information about a Notehub project by ProductUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/products/{productUID}/project |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/products/<productUID>/project'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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);
}
);
import notehub_py
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
product_uid = "com.blues.airnote" # str |
try:
api_response = api_instance.get_project_by_product(product_uid)
print("The response of ProjectApi->get_project_by_product:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_by_product: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the project.
label
string
The user-assigned label for the project.
created
string
The date and time the project was created in Notehub.
administrative_contact
object
Contact information for the administrative contact assigned in Notehub.
technical_contact
object
Contact information for the technical contact assigned in Notehub.
role
string
The role of the project member creating the API request.
{
"uid": "app:00000000-0000-0000-0000-000000000000",
"label": "My Notehub Project",
"created": "2021-04-26T19:11:05Z",
"administrative_contact": {
"name": "John Doe",
"email": "someone@example.com",
"role": "Admin",
"organization": "Blues"
},
"technical_contact": {
"name": "Jane Doe",
"email": "someone@example.com",
"role": "Tech",
"organization": "Blues"
},
"role": "owner"
}
Create Project Notehub
Create a new Notehub project.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects |
Minimum Notehub project-level role: | owner |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
label
string
The label of the Notehub project.
billing_account_uid
string
The globally-unique identifier of the billing account. The caller of the API must be able to create projects within the specified billing account, otherwise an error will be returned. This identifier is available with a call to Get Billing Accounts.
curl -X POST
-L 'https://api.notefile.net/v1/projects'
-H 'Authorization: Bearer <access_token>'
-d '{"label":"<label>", "billing_account_uid":"<my_billing_account_here>"}'
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 createProjectProps = {
label: "My New Project", // String |
billingAccountUid: "billing-account-uid" // String |
}
let createProjectRequest = new NotehubJs.CreateProjectRequest(createProjectProps); // CreateProjectRequest | Project to be created
apiInstance.createProject(createProjectRequest).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
import notehub_py
from notehub_py.models.create_project_request import CreateProjectRequest
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_request_props = {
"label": "label_example",
"billing_account_uid": "billing_account_uid_example"
}
create_project_request = notehub_py.CreateProjectRequest() # CreateProjectRequest | Project to be created
try:
api_response = api_instance.create_project(create_project_request)
print("The response of ProjectApi->create_project:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->create_project: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the project.
label
string
The user-assigned label for the project.
created
string
The date and time the project was created in Notehub.
administrative_contact
object
Contact information for the administrative contact assigned in Notehub. Will be
null
on newly-created projects.
technical_contact
object
Contact information for the technical contact assigned in Notehub. Will be
null
on newly-created projects.
role
string
The role of the project member creating the API request.
{
"uid": "app:00000000-0000-0000-0000-000000000000",
"label": "My Notehub Project",
"created": "2021-04-26T19:11:05Z",
"administrative_contact": null,
"technical_contact": null,
"role": "owner"
}
Delete Project Notehub
Delete a Notehub project by ProjectUID.
HTTP Method: | DELETE |
URL: | https://api.notefile.net/v1/projects/{projectUID} |
Path Parameters: |
|
Minimum Notehub project-level role: | owner |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.deleteProject(projectUID).then(() => {
console.log("API called successfully.");
}, (error) => {
console.error(error);
});
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.delete_project(project_uid)
except Exception as e:
print("Exception when calling ProjectApi->delete_project: %s\n" % e)
Response Members
{}
means success.Clone Project Notehub
Clone a Notehub project.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects/{projectUID}/clone |
Path Parameters: |
|
Minimum Notehub project-level role: | owner |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
label
string
The user-assigned label for the project.
billing_account_uid
string
The globally-unique identifier of the billing account. The caller of the API must be able to create projects within the specified billing account, otherwise an error will be returned. This identifier is available with a call to Get Billing Accounts.
disable_clone_routes
boolean
Whether to disallow the cloning of the routes from the parent project. Default is false if not specified.
disable_clone_fleets
boolean
Whether to disallow the cloning of the fleets from the parent project. Default is false if not specified.
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/clone'
-H 'Authorization: Bearer <access_token>'
-d '{"label":"<label>",
"billing_account_uid":"<billing_account_uid>",
"disable_clone_routes":<disable_clone_routes>,
"disable_clone_fleets":<disable_clone_fleets>}'
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 cloneProjectProps = {
label: "My Cloned Project", // String |
billingAccountUid: "billing-account-uid", // String |
disableCloneRoutes: false, // Boolean |
disableCloneFleets: true // Boolean |
}
let cloneProjectRequest = new NotehubJs.CloneProjectRequest(cloneProjectProps); // 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);
}
);
import notehub_py
from notehub_py.models.clone_project_request import CloneProjectRequest
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "project_uid_example" # str | The project UID to be cloned.
clone_project_props = {
"label": "label_example",
"billing_account_uid": "billing_account_uid_example",
"disable_clone_routes": True,
"disable_clone_fleets": True
}
clone_project_request = notehub_py.CloneProjectRequest(clone_project_props) # CloneProjectRequest | Project to be cloned
try:
api_response = api_instance.clone_project(project_uid, clone_project_request)
print("The response of ProjectApi->clone_project:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->clone_project: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the project.
label
string
The user-assigned label for the project.
created
string
The date and time the project was created in Notehub.
administrative_contact
object
Contact information for the administrative contact assigned in Notehub. Will be
null
on newly-created projects.
technical_contact
object
Contact information for the technical contact assigned in Notehub. Will be
null
on newly-created projects.
role
string
The role of the project member creating the API request.
{
"uid": "app:00000000-0000-0000-0000-000000000000",
"label": "My Cloned Notehub Project",
"created": "2021-04-26T19:11:05Z",
"administrative_contact": null,
"technical_contact": null,
"role": "owner"
}
Get Project Members Notehub
Get all members from a Notehub project.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/members |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/members'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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);
}
);
import notehub_py
from notehub_py.models.get_project_members200_response import GetProjectMembers200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_members(project_uid)
print("The response of ProjectApi->get_project_members:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_members: %s\n" % e)
Response Members
name
string
The name of the project member.
email
string
The email address of the project member (only provided if the auth token provider is an owner of the project).
role
string
The role of the project member (e.g. viewer, developer, or owner).
{
"members": [
{
"name": "Jane Doe",
"email": "someone@blues.com",
"role": "owner"
},
{
"name": "John Doe",
"email": "someone@blues.com",
"role": "developer"
}
]
}
Create Product Notehub
Create a new Notehub product using a ProjectUID.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects/{projectUID}/products |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
product_uid
string
The requested ProductUID (without the reverse URL prefix notation).
label
string
The requested label for the product.
fleet_uids
string array (optional)
An array of FleetUIDs to which new devices should be auto-assigned.
disable_devices
boolean (optional)
If true
, devices provisioned to this product will be automatically disabled by
default.
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/products'
-H 'Authorization: Bearer <access_token>'
-d '{"product_uid":"<product_uid>", "label":"<label>"}'
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 createProductProps = {
productUid: "product_uid", // String |
label: "Product 1", // String |
autoProvisionFleets: ["fleet_uid_1", "fleet_uid_2"], // [String] |
disableDevicesByDefault: true // Boolean |
}
let createProductRequest = new NotehubJs.CreateProductRequest(createProductProps); // 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);
}
);
import notehub_py
from notehub_py.models.create_product_request import CreateProductRequest
from notehub_py.models.product import Product
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
product_request_props = {
"product_uid": "product_uid_example",
"label": "label_example",
"auto_provision_fleets": [
"fleet_id_1",
"fleet_id_2"
],
"disable_devices_by_default": True
}
create_product_request = notehub_py.CreateProductRequest(product_request_props) # CreateProductRequest | Product to be created
try:
api_response = api_instance.create_product(project_uid, create_product_request)
print("The response of ProjectApi->create_product:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->create_product: %s\n" % e)
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/products'
-H 'Authorization: Bearer <access_token>'
-d '{"product_uid":"<product_uid>", "label":"<label>", "auto_provision_fleets":"<fleet_uids>", "disable_devices_by_default":"<disable_devices>"}'
Response Members
uid
string
The globally-unique identifier for the product.
label
string
The user-defined label of the product.
auto_provision_fleets
string array
The globally-unique fleet identifiers to which new devices will automatically be provisioned.
disable_devices_by_default
boolean
Whether or not new devices will be disabled by default.
{
"uid": "com.blues.test:product",
"label": "My Product Label",
"auto_provision_fleets": null,
"disable_devices_by_default": false
}
Get Products Notehub
Get an array of products from a Notehub project, using a ProjectUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/products |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/products'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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);
}
);
import notehub_py
from notehub_py.models.get_project_products200_response import GetProjectProducts200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_products(project_uid)
print("The response of ProjectApi->get_project_products:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_products: %s\n" % e)
Response Members
product_uid
string
The globally-unique identifier for the product.
label
string
The user-defined label of the product.
auto_provision_fleets
string
An array of globally-unique FleetUIDs to which new devices will automatically be provisioned.
disable_devices_by_default
boolean
If true
, devices provisioned to this product will be automatically disabled by
default.
{
"products": [
{
"uid": "product:com.your-company.your-name:project",
"label": "My Notehub Product",
"auto_provision_fleets": ["fleet:00000000-0000-0000-0000-000000000000"],
"disable_devices_by_default": false
}
]
}
Get Project Environment Variables Notehub
Get all project-level environment variables by ProjectUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/environment_variables |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/environment_variables'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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);
}
);
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_environment_variables(project_uid)
print("The response of ProjectApi->get_project_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_environment_variables: %s\n" % e)
Response Members
environment_variables
object
JSON object containing environment variables in "key":"value"
format.
{
"environment_variables": {
"project_humidity": "33.4",
"project_temp": "24.1"
}
}
Delete Project Environment Variable Notehub
Delete a project-level environment variable by ProjectUID and environment variable key.
HTTP Method: | DELETE |
URL: | https://api.notefile.net/v1/projects/{projectUID}/environment_variables/{key} |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>/environment_variables/<key>'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.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);
}
);
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
key = "key_example" # str | The environment variable key to delete.
try:
api_response = api_instance.delete_project_environment_variable(project_uid, key)
print("The response of ProjectApi->delete_project_environment_variable:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->delete_project_environment_variable: %s\n" % e)
Response Members
environment_variables
object
JSON object containing environment variables in "key":"value"
format.
{
"environment_variables": {
"project_humidity": "33.4",
"project_temp": "24.1"
}
}
Set Project Environment Variables Notehub
Set project-level environment variables by ProjectUID.
HTTP Method: | PUT |
URL: | https://api.notefile.net/v1/projects/{projectUID}/environment_variables |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
env_vars
object
A JSON object containing the key-value pair(s) of environment variable(s) to
add. For example: {"key1":"value1","key2":"value2"}
.
curl -X PUT
-L 'https://api.notefile.net/v1/projects/<projectUID>/environment_variables'
-H 'Authorization: Bearer <access_token>'
-d '{"environment_variables":<env_vars>}'
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 envVars = {key1: "value1", key2: "value2"} // {String: String}
let opts = {
environmentVariables: new NotehubJs.EnvironmentVariables(envVars), // EnvironmentVariables |
};
apiInstance.putProjectEnvironmentVariables(projectUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
env_vars = {"key_1": "value_1", "key_2": "value_2"} # Dict[str, str] |
environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | (optional)
try:
api_response = api_instance.put_project_environment_variables(project_uid, environment_variables=environment_variables)
print("The response of ProjectApi->put_project_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->put_project_environment_variables: %s\n" % e)
Response Members
environment_variables
object
JSON object containing environment variables in "key":"value"
format.
{
"environment_variables": {
"project_humidity": "33.4",
"project_temp": "24.1"
}
}
Get Fleet Environment Variables Notehub
Get all fleet-level environment variables by ProjectUID and FleetUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/environment_variables'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
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);
}
);
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
try:
api_response = api_instance.get_fleet_environment_variables(project_uid, fleet_uid)
print("The response of ProjectApi->get_fleet_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_fleet_environment_variables: %s\n" % e)
Response Members
environment_variables
object
JSON object containing environment variables in "key":"value"
format.
{
"environment_variables": {
"fleet_humidity": "33.4",
"fleet_temp": "24.1"
}
}
Delete Fleet Environment Variable Notehub
Delete a fleet-level environment variable on a Notehub project by ProjectUID, FleetUID, and environment variable key.
HTTP Method: | DELETE |
URL: | https://api.notefile.net/v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables/{key} |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/environment_variables/<key>'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
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);
}
);
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
key = "key_example" # str | The environment variable key to delete.
try:
api_response = api_instance.delete_fleet_environment_variable(project_uid, fleet_uid, key)
print("The response of ProjectApi->delete_fleet_environment_variable:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->delete_fleet_environment_variable: %s\n" % e)
Response Members
environment_variables
object
JSON object containing environment variables in "key":"value"
format.
{
"environment_variables": {
"fleet_humidity": "33.4",
"fleet_temp": "24.1"
}
}
Set Fleet Environment Variables Notehub
Set fleet-level environment variables by ProjectUID and FleetUID.
HTTP Method: | PUT |
URL: | https://api.notefile.net/v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
env_vars
object
A JSON object containing the key-value pair(s) of environment variable(s) to be
added to the fleet. For example: {"key1":"value1","key2":"value2"}
.
curl -X PUT
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/environment_variables'
-H 'Authorization: Bearer <access_token>'
-d '{"environment_variables":<env_vars>}'
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 envVars = {key1: "value1", key2: "value2"} // {String: String}
let environmentVariables = new NotehubJs.EnvironmentVariables(envVars); // 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);
}
);
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
env_vars = {"key_1": "value_1", "key_2": "value_2"} # Dict[str, str] |
environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | Environment variables to be added to the fleet
try:
api_response = api_instance.put_fleet_environment_variables(project_uid, fleet_uid, environment_variables)
print("The response of ProjectApi->put_fleet_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->put_fleet_environment_variables: %s\n" % e)
Response Members
environment_variables
object
JSON object containing environment variables in "key":"value"
format.
{
"environment_variables": {
"fleet_humidity": "33.4",
"fleet_temp": "24.1"
}
}
Get Fleets Notehub
Get an array of fleets associated with a ProjectUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/fleets |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
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);
}
);
import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_fleets(project_uid)
print("The response of ProjectApi->get_project_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_fleets: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the fleet.
label
string
The user-defined label of the fleet.
created
string
The date and time the fleet was created.
{
"fleets": [
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Production",
"created": "2021-04-10T21:18:38Z"
},
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Staging",
"created": "2021-02-11T01:03:46Z"
},
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Testing",
"created": "2021-02-11T01:03:32Z"
}
]
}
Create Fleet Notehub
Create a new device fleet within a Notehub project.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects/{projectUID}/fleets |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
label
string
The requested label for the fleet.
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets'
-H 'Authorization: Bearer <access_token>'
-d '{"label":"<label>"}'
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 fleetLabel = "My New Fleet"; // String | The label for the Fleet.
let createFleetRequest = new NotehubJs.CreateFleetRequest(fleetLabel); // 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);
}
);
import notehub_py
from notehub_py.models.create_fleet_request import CreateFleetRequest
from notehub_py.models.fleet import Fleet
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_label = "fleet_label_example" # str |
create_fleet_request = notehub_py.CreateFleetRequest(fleet_label) # CreateFleetRequest | Fleet to be added
try:
api_response = api_instance.create_fleet(project_uid, create_fleet_request)
print("The response of ProjectApi->create_fleet:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->create_fleet: %s\n" % e)
Response Members
uid
string
The globally-unique identifier for the fleet.
label
string
The user-defined label of the fleet.
created
time stamp
The date/time the fleet was created.
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "My Fleet Label",
"created": "2021-10-12T16:21:54Z"
}
Update Fleet Notehub
Update a fleet's label or devices by FleetUID.
HTTP Method: | PUT |
URL: | https://api.notefile.net/v1/projects/{projectUID}/fleets/{fleetUID} |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
label
string
The updated label for the fleet.
addDevices
array (optional)
A list of DeviceUIDs to add to the fleet.
removeDevices
array (optional)
A list of DeviceUIDs to remove from the fleet.
curl -X PUT
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>'
-H 'Authorization: Bearer <access_token>'
-d '{"label":"<label>"}'
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 updateFleetRequest = {
label: "Fleet Label",
addDevices: ["device_id_1", "device_id_2"],
removeDevices: ["device_id_3", "device_id_4"]
} // 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);
}
);
import notehub_py
from notehub_py.models.fleet import Fleet
from notehub_py.models.update_fleet_request import UpdateFleetRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
fleet_request_properties = {
"label": "fleet_label_1",
"add_devices": ["device_uid_1", "device_uid_2"],
"remove_devices": ["device_uid_3", "device_uid_4"]
}
update_fleet_request = notehub_py.UpdateFleetRequest(fleet_request_properties) # UpdateFleetRequest | Fleet details to update
try:
api_response = api_instance.update_fleet(project_uid, fleet_uid, update_fleet_request)
print("The response of ProjectApi->update_fleet:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->update_fleet: %s\n" % e)
Response Members
uid
string
The globally-unique identifier for the fleet.
label
string
The user-defined label of the fleet.
created
time stamp
The date/time the fleet was created.
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "My Fleet Label",
"created": "2021-10-12T16:21:54Z"
}
Delete Fleet Notehub
Delete a device fleet.
HTTP Method: | DELETE |
URL: | https://api.notefile.net/v1/projects/{projectUID}/fleets/{fleetUID} |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
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);
}
);
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
try:
api_instance.delete_fleet(project_uid, fleet_uid)
except Exception as e:
print("Exception when calling ProjectApi->delete_fleet: %s\n" % e)
Get Device Fleets Notehub
Get an array of fleets associated with a device.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/fleets |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/fleets'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
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);
}
);
import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.get_device_fleets(project_uid, device_uid)
print("The response of ProjectApi->get_device_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_device_fleets: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the fleet.
label
string
The user-defined label of the fleet.
created
string
The date and time the fleet was created.
{
"fleets": [
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Production",
"created": "2021-04-10T21:18:38Z"
},
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Staging",
"created": "2021-02-11T01:03:46Z"
},
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Testing",
"created": "2021-02-11T01:03:32Z"
}
]
}
Add Device to Fleets Notehub
Add a device to one of more fleets.
HTTP Method: | PUT |
URL: | https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/fleets |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X PUT
-L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/fleets'
-H 'Authorization: Bearer <access_token>'
-d '{"fleet_uids":[<fleet_uids>]}'
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 deviceUID = "deviceUID_example"; // String |
let putDeviceFleetUids = ["fleetUID1", "fleetUID2"] // [String]
let putDeviceFleetsRequest = new NotehubJs.PutDeviceFleetsRequest(putDeviceFleetUids); // 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);
}
);
import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.models.put_device_fleets_request import PutDeviceFleetsRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
fleet_uids = ["fleet_uid_1", "fleet_uid_2"] # List[str] | An array of Fleet UIDs.
put_device_fleets_request = notehub_py.PutDeviceFleetsRequest(fleet_uids) # PutDeviceFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
try:
api_response = api_instance.put_device_fleets(project_uid, device_uid, put_device_fleets_request)
print("The response of ProjectApi->put_device_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->put_device_fleets: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the fleet.
label
string
The user-defined label of the fleet.
created
string
The date and time the fleet was created.
{
"fleets": [
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Production",
"created": "2021-04-10T21:18:38Z"
},
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Staging",
"created": "2021-02-11T01:03:46Z"
},
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Testing",
"created": "2021-02-11T01:03:32Z"
}
]
}
Remove Device from Fleets Notehub
Removes a device from one or more fleets.
HTTP Method: | DELETE |
URL: | https://api.notefile.net/v1/projects/{projectUID}/devices/{deviceUID}/fleets |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/fleets'
-H 'Authorization: Bearer <access_token>'
-d '{"fleet_uids":[<fleet_uids>]}'
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 deviceUID = "deviceUID_example"; // String |
let deleteDeviceFleetUids = ["fleetUID1", "fleetUID2"] // [String]
let deleteDeviceFleetsRequest = new NotehubJs.DeleteDeviceFleetsRequest(deleteDeviceFleetUids); // 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);
}
);
import notehub_py
from notehub_py.models.delete_device_fleets_request import DeleteDeviceFleetsRequest
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
fleet_uids = [
"fleet_uid_1",
"fleet_uid_2"
]
delete_device_fleets_request = notehub_py.DeleteDeviceFleetsRequest(fleet_uids) # DeleteDeviceFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
try:
api_response = api_instance.delete_device_fleets(project_uid, device_uid, delete_device_fleets_request)
print("The response of ProjectApi->delete_device_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->delete_device_fleets: %s\n" % e)
Response Members
uid
string
The globally-unique identifier of the fleet.
label
string
The user-defined label of the fleet.
created
string
The date and time the fleet was created.
{
"fleets": [
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Production",
"created": "2021-04-10T21:18:38Z"
},
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Staging",
"created": "2021-02-11T01:03:46Z"
},
{
"uid": "fleet:00000000-0000-0000-0000-000000000000",
"label": "Testing",
"created": "2021-02-11T01:03:32Z"
}
]
}
Set Global JSONata Transform Notehub
Set the global JSONata transform for a Notehub project.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects/{projectUID}/global-transformation |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/global-transformation'
-H 'Authorization: Bearer <access_token>'
-d '<jsonata>'
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);
});
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
body = None # object | JSONata expression which will be applied to each event before it is persisted and routed
try:
api_instance.set_global_transformation(project_uid, body)
except Exception as e:
print("Exception when calling ProjectApi->set_global_transformation: %s\n" % e)
Response Members
{}
means success.Enable Global JSONata Transform Notehub
Enables the global JSONata transform for a Notehub project.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects/{projectUID}/global-transformation/enable |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/global-transformation/enable'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.enableGlobalTransformation(projectUID).then(() => {
console.log("API called successfully.");
}, (error) => {
console.error(error);
});
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.enable_global_transformation(project_uid)
except Exception as e:
print("Exception when calling ProjectApi->enable_global_transformation: %s\n" % e)
Response Members
{}
means success.Disable Global JSONata Transform Notehub
Disables the global JSONata transform for a Notehub project.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects/{projectUID}/global-transformation/disable |
Path Parameters: |
|
Minimum Notehub project-level role: | developer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/global-transformation/disable'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.disableGlobalTransformation(projectUID).then(() => {
console.log("API called successfully.");
}, (error) => {
console.error(error);
});
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.disable_global_transformation(project_uid)
except Exception as e:
print("Exception when calling ProjectApi->disable_global_transformation: %s\n" % e)
Response Members
{}
means success.Get Available Firmware Notehub
Get an array of available firmware files by ProjectUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/firmware |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
firmwareType
string (optional)
Limit the query to return only certain types of firmware. Available options are
"notecard"
for Notecard firmware or "host"
for host firmware.
This argument defaults to "notecard"
.
target
string (optional)
The target architecture of Notecard firmware to return. Available values:
"r5"
, "s3"
, "u5"
, "wl"
.
See Notecard Firmware Updates for details.
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/firmware'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
product: "product_example", // String |
firmwareType: "firmwareType_example", // String |
version: "version_example", // String |
target: "target_example", // String |
filename: "notecard-7.2.2.16518$20240410043100.bin", // String |
md5: "md5_example", // String |
unpublished: true // Boolean |
};
apiInstance.getFirmwareInfo(projectUID, opts).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
import notehub_py
from notehub_py.models.firmware_info import FirmwareInfo
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
product = "product_example" # str | (optional)
firmware_type = "firmware_type_example" # str | (optional)
version = "version_example" # str | (optional)
target = "target_example" # str | (optional)
filename = "notecard-7.2.2.16518$20240410043100.bin" # str | (optional)
md5 = "md5_example" # str | (optional)
unpublished = True # bool | (optional)
try:
api_response = api_instance.get_firmware_info(project_uid, product=product, firmware_type=firmware_type, version=version, target=target, filename=filename, md5=md5, unpublished=unpublished)
print("The response of ProjectApi->get_firmware_info:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_firmware_info: %s\n" % e)
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/firmware?firmwareType=<type>&target=<target>'
-H 'Authorization: Bearer <access_token>'
Response Members
filename
string
The filename of the firmware file.
version
string
The version number of the firmware file.
MD5
string
The MD5 hash of the firmware file.
organization
string
The organization distributing the firmware.
type
string
The type of firmware file, either "notecard"
or "host"
.
created
UNIX Epoch time
A timestamp for when the firmware file was created.
target
string
The target architecture for Notecard firmware file.
[
{
"filename": "notecard-wl-7.2.2.16518$20240410043100.bin",
"version": "notecard-wl-7.2.2",
"MD5": "8c1f7737a134f108dab02ec6d6b4bf25",
"organization": "Blues Wireless",
"type": "notecard",
"created": "1712780230",
"target": "wl"
},
...
]
Update Firmware Notehub
Request an OTA firmware update of devices on a project by ProjectUID. You can use this endpoint to request both Notecard and host firmware updates.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects/{projectUID}/ota/update |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
filename
string (optional)
The filename of the firmware file to use for the update.
device_uids
string[] (optional)
An array of DeviceUIDs to update.
fleet_uids
string[] (optional)
An array of FleetUIDs to update.
device_tags
string[] (optional)
An array of tags. If provided, the firmware update will only be performed on devices that contain one of the provided tags.
version
string (optional)
The version of the firmware file to use for the update.
MD5
string (optional)
The MD5 hash of the firmware file to use for the update.
type
string (optional)
The type of firmware update to perform. Available values are "notecard"
for
updating Notecard firmware, and "host"
for updating host firmware.
cancel_dfu
boolean (optional)
If provided and true
, cancel any scheduled firmware updates.
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/ota/update'
-H 'Authorization: Bearer <access_token>'
-d '{"filename":"notecard-6.1.1.16332$20231222144855.bin"}'
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/ota/update'
-H 'Authorization: Bearer <access_token>'
-d '{"filename":"1.1.0$20240130134913.binpack"}'
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/ota/update'
-H 'Authorization: Bearer <access_token>'
-d '{"filename":"1.1.0$20240130134913.binpack","device_uids":["dev:868050040247765"]}'
curl -X POST
-L 'https://api.notefile.net/v1/projects/<projectUID>/ota/update'
-H 'Authorization: Bearer <access_token>'
-d '{"cancel_dfu":true,"type":"notecard"}'
Response Members
failed
string[]
An array of DeviceUIDs where the firmware update did not schedule successfully.
successful
string[]
An array of DeviceUIDs where the firmware update was scheduled successfully.
status
string
The status of the firmware update request. This is set to "success"
if all
updates were scheduled successfully.
{
"failed": null,
"status": "success",
"successful": [
"dev:868050040247765",
"dev:860322068093969"
]
}
Get Firmware Update Status Notehub
Retrieve the status of OTA firmware updates on devices by ProjectUID. You can use this endpoint to receive the status of both Notecard and host firmware updates.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/ota/status |
Path Parameters: |
|
Minimum Notehub project-level role: | viewer |
Required HTTP Headers: | Authorization: Bearer <access_token> , where the access token is a Notehub API bearer token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/ota/status'
-H 'Authorization: Bearer <access_token>'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.ProjectApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
deviceUIDs: ["null"], // [String] | An array of Device UIDs.
fleetUIDs: ["null"], // [String] |
deviceTags: ["null"], // [String] |
pageSize: 50, // Number |
pageNum: 1 // Number |
};
apiInstance.getProjectOTAStatus(projectUID, opts).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
import notehub_py
from notehub_py.models.ota_status_list import OTAStatusList
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uids = ["device_uid_1", "device_uid_2"] # List[str] | An array of Device UIDs. (optional)
fleet_uids = ["fleet_uid_1", "fleet_uid_2"] # List[str] | (optional)
device_tags = ["device_tags_1", "device_tag_2"] # List[str] | (optional)
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
try:
api_response = api_instance.get_project_ota_status(project_uid, device_uids=device_uids, fleet_uids=fleet_uids, device_tags=device_tags, page_size=page_size, page_num=page_num)
print("The response of ProjectApi->get_project_ota_status:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_ota_status: %s\n" % e)
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/ota/status?deviceUIDs=dev:868050040247765,dev:860322068093969'
-H 'Authorization: Bearer <access_token>'
Response Members
device_uid
string
The DeviceUID of the device.
notecard_current_firmware
object
Information on the version of Notecard firmware currently running on the device.
notecard_dfu_status
string
The status of the Notecard firmware update on the device.
notecard_requested_firmware
object
Information on the version of Notecard firmware requested for the device.
notecard_requested_at
string
An ISO 8601 formatted timestamp indicating when the Notecard firmware update was requested.
notecard_requested_scope
string
The scope of the requested Notecard firmware update, which will be either
"device"
, "fleet"
, or "project"
.
notecard_requested_status
string
The status of any scheduled Notecard firmware update.
host_current_firmware
object
Information on the current host firmware running on the device.
host_requested_firmware
object
Information on the version of host firmware requested for the device.
host_requested_at
string
An ISO 8601 formatted timestamp indicating when the host firmware update was requested.
host_requested_scope
string
The scope of the requested host firmware update, which will be either
"device"
, "fleet"
, or "project"
.
host_requested_status
string
The status of any scheduled host firmware update.
{
"devices": [
{
"device_uid": "dev:868050040247765",
"notecard_current_firmware": {
"version": "6.1.1.16332",
"organization": "Blues Wireless",
"product": "Notecard",
"built": "Dec 22 2023 14:43:52"
},
"notecard_dfu_status": "Idle",
"notecard_requested_firmware": {
"version": "7.2.2.16518",
"organization": "Blues Wireless",
"product": "Notecard",
"built": "Apr 10 2024 04:22:29"
},
"notecard_requested_at": "2024-06-12 19:11:25",
"notecard_requested_scope": "device",
"notecard_requested_status": "Pending device sync",
"host_current_firmware": {},
"host_dfu_status": "Idle",
"host_requested_firmware": {
"version": "1.1.0$20240130134913.binpack"
},
"host_requested_at": "2024-06-12 19:12:57",
"host_requested_scope": "device",
"host_requested_status": "Pending device sync"
},
...
]
}