Environment Variable API
The Notehub environment variable API provides RESTful methods that can be used
to GET
, PUT
, and DELETE
data related to
environment variables.
Get Environment Variables This request can be performed using the Notehub API.Notehub
Get all project-level environment variables by ProjectUID.
Minimum Notehub project-level role required:
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/environment_variables'
-H 'Authorization: Bearer <access_token>'
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 Environment Variables This request can be performed using the Notehub API.Notehub
Set project-level environment variables by ProjectUID.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
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>}'
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 Environment Variable This request can be performed using the Notehub API.Notehub
Delete a project-level environment variable by ProjectUID and environment variable key.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
key
string
The key from the key/value pair of the environment variable to be deleted.
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>/environment_variables/<key>'
-H 'Authorization: Bearer <access_token>'
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 Environment Variables by Fleet This request can be performed using the Notehub API.Notehub
Get all fleet-level environment variables by ProjectUID and FleetUID.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
fleetUID
string
The FleetUID of a Notehub device fleet.
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/environment_variables'
-H 'Authorization: Bearer <access_token>'
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 Environment Variables by Fleet This request can be performed using the Notehub API.Notehub
Set fleet-level environment variables by ProjectUID and FleetUID.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
fleetUID
string
The FleetUID of a Notehub device fleet.
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>}'
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 Environment Variable by Fleet This request can be performed using the Notehub API.Notehub
Delete a fleet-level environment variable on a Notehub project by ProjectUID, FleetUID, and environment variable key.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
fleetUID
string
The FleetUID of a Notehub device fleet.
key
string
The key from the key/value pair of the environment variable to be deleted.
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/environment_variables/<key>'
-H 'Authorization: Bearer <access_token>'
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 Environment Variables by Device This request can be performed using the Notehub API.Notehub
Get all device-level environment variables by ProjectUID and DeviceUID.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
deviceUID
string
The DeviceUID of a Notehub device.
You may alternatively provide a device serial number by prefixing this argument
with sn:
, for example sn:my-device
.
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/environment_variables'
-H 'Authorization: Bearer <access_token>'
Response Members
environment_variables
object
JSON object containing device-level environment variables in "key":"value"
format.
environment_variables_env_default
object
JSON object containing any default environment variables in "key":"value"
format.
{
"environment_variables": {
"_tags": "",
"device_humidity": "55.9",
"device_temp": "79.0"
},
"environment_variables_env_default": {}
}
Set Environment Variables by Device This request can be performed using the Notehub API.Notehub
Set device-level environment variables by ProjectUID and DeviceUID.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
deviceUID
string
The DeviceUID of a Notehub device.
You may alternatively provide a device serial number by prefixing this argument
with sn:
, for example sn:my-device
.
env_vars
object
A JSON object containing the key/value pair(s) of environment variable(s) to be added. For example: {"key1":"value1","key2":"value2"}
.
curl -X PUT
-L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/environment_variables'
-H 'Authorization: Bearer <access_token>'
-d '{"environment_variables":<env_vars>}'
Response Members
environment_variables
object
JSON object containing environment variables in "key":"value"
format.
{
"environment_variables": {
"_tags": "",
"device_humidity": "55.9",
"device_temp": "79.0"
}
}
Delete Environment Variable by Device This request can be performed using the Notehub API.Notehub
Delete an environment variable by ProjectUID, DeviceUID, and environment variable key.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
deviceUID
string
The DeviceUID of a Notehub device.
You may alternatively provide a device serial number by prefixing this argument
with sn:
, for example sn:my-device
.
key
string
The key from the key/value pair of the environment variable to be deleted.
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/environment_variables/<key>'
-H 'Authorization: Bearer <access_token>'
Response Members
environment_variables
object
JSON object containing environment variables in "key":"value"
format.
{
"environment_variables": {
"_tags": "",
"device_humidity": "55.9",
"device_temp": "79.0"
}
}