Route API
The Notehub route API provides RESTful methods that can be used to GET
, PUT
,
POST
, and DELETE
Notehub routes.
Get Routes
Get an array of routes associated with a Notehub project.
Minimum Notehub project-level role required:
curl -X GET -L 'https://api.notefile.net/v1/projects/<projectUID>/routes' -H 'Authorization: Bearer <access_token>'
Response Members
uid
string
The globally-unique identifier of the route.
label
string
The name of the route.
type
string
The service to which this route connects (see Create Route for a full list of route types).
modified
string
The date and time this route was last modified.
disabled
boolean
Whether or not this route is disabled.
[ { "uid": "route:0ac565deb7b478a250bb82347b9cfdd2", "label": "My HTTP Route", "type": "http", "modified": "2020-03-09T17:58:36Z", "disabled": false }, { "uid": "route:fb1b9e0aba1bf030311ba2c3c1e7efd1", "label": "My Proxy Route", "type": "proxy", "modified": "2020-03-09T17:58:35Z", "disabled": false } ]
Get Route by UID
Get a single route by its RouteUID.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
routeUID
string
The RouteUID of a route.
curl -X GET -L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>' -H 'Authorization: Bearer <access_token>'
Response Members
uid
string
The globally-unique identifier of the route.
label
string
The name of the route.
type
string
The service to which this route connects (see above for a full list of route types).
modified
string
The date and time this route was last modified.
disabled
boolean
Whether or not this route is disabled.
schema
object
Additional meta data specific to the type of route (see request members from Create Route for a complete list).
{ "uid": "route:0ac565deb7b478a250bb82347b9cfdd2", "label": "My HTTP Route", "type": "http", "modified": "2020-03-09T17:58:36Z", "disabled": false, "http": { "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"], "filter": { "type": "", "system_notefiles": false }, "transform": {}, "throttle_ms": 100, "url": "http://route.url", "http_headers": null, "disable_http_headers": false, "timeout": 0 } }
Create Route
Create a new route within a Notehub project.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
label
string
The name of the route.
type
string
The specific service to which this route connects.
Must be one of: "http", "proxy", "google-function", "mqtt", "aws-lambda", "aws-lambda-with-access-key", "aws-sqs", "aws-sqs-with-access-key", "aws-sqs-fifo", "aws-sqs-fifo-with-access-key", "aws-iot-analytics", "radnote-radresp-fixed-survey", "radnote-radresp-mobile-survey", "azure-function", "azure-function-with-key", "azure-service-bus-with-sas-token", "thingworx", "snowflake", "twilio".
disabled
boolean
Whether or not this route is disabled.
schema
string
Name of the high level route schema, used to supply settings specific to the
chosen type
.
Must be one of: "http", "google", "proxy", "mqtt", "aws", "radresponder", "azure", "thingworx", "snowflake", "twilio".
fleets
string
An array of fleetUIDs to which to apply the route. If empty, applies to all fleets.
filter
object
Applies to all route schemas except "proxy" and "radresponder".
Route filtering settings; see below:
filter.type
string
Which Notefiles this route applies to. Must be one of: "all", "include", "exclude".
filter
.system
_notefiles
boolean
Whether or not system Notefiles should be routed.
filter.files
string
An array of Notefile names to include in the filter. For example, if include
is the type
, these are the only Notefiles that will be included.
transform
object
Applies to all route schemas except "proxy" and "radresponder".
Data transformation settings; see below:
transform
.format
string
The data transformation to apply.
Must be one of: "bridge" (Azure only), "jsonata", "flatten", "simple", "body", "payload".
transform
.jsonata
string
If jsonata
format, the JSONata expression to be used.
throttle_ms
integer
Applies to all route schemas except "proxy", "radresponder", and "snowflake".
Minimum time between requests, in milliseconds.
url
string
Applies to all route schemas except "mqtt", "radresponder", "snowflake", and "twilio".
The external service endpoint URL.
http_headers
object
Only applies to "http", "proxy", and "aws" route schemas.
Key:value pairs of HTTP headers. Both the key and value are strings.
disable
_http
_headers
boolean
Only applies to "http" and "aws" route schemas.
Whether or not the HTTP header values should be disabled.
timeout
integer
Applies to all route schemas except "radresponder".
Timeout in seconds for each request.
region
string
Only applies to "aws" route schema using "aws-lambda-with-access-key", "aws-sqs-with-access-key", "aws-sqs-fifo-with-access-key", or "aws-iot-analytics" route types.
The AWS geographic region (e.g. us-east-1
).
access_key_id
string
Only applies to "aws" route schema using "aws-lambda-with-access-key", "aws-sqs-with-access-key", "aws-sqs-fifo-with-access-key", or "aws-iot-analytics" route types.
The public access key used to make calls to AWS.
access
_key
_secret
string
Only applies to "aws" route schema using "aws-lambda-with-access-key", "aws-sqs-with-access-key", "aws-sqs-fifo-with-access-key", or "aws-iot-analytics" route types.
The secret access key used to make calls to AWS.
message
_group
_id
string
Only applies to "aws" route schema using "aws-sqs-fifo" or "aws-sqs-fifo-with-access-key" route types.
The tag that specifies that a message belongs to a specific message group.
message
_deduplication
_id
string
Only applies to "aws" route schema using "aws-sqs-fifo" or "aws-sqs-fifo-with-access-key" route types.
The token used for deduplication of sent messages.
channel
string
Only applies to "aws" route schema using "aws-iot-analytics" route type.
The AWS IoT Analytics channel.
sas_policy_name
string
Only applies to "azure" route schema using "azure-service-bus-with-sas-token" route type.
The Azure SAS policy name used to authenticate to a resource.
sas_policy_key
string
Only applies to "azure" route schema using "azure-service-bus-with-sas-token" route type.
The Azure SAS policy key used to authenticate to a resource.
app_key
string
Only applies to "thingworx" route schema.
The ThingWorx security token.
broker
string
Only applies to "mqtt" route schema.
The MQTT broker URL. The URL should be of the form scheme://host
where scheme
is one of "mqtt", "mqtts", "tcp", "ssl", "ws", or "wss".
port
integer
Only applies to "mqtt" route schema.
The port of the MQTT broker instance.
username
string
Only applies to "mqtt" route schema.
The MQTT username for authentication.
password
string
Only applies to "mqtt" route schema.
The MQTT password for authentication.
topic
string
Only applies to "mqtt" route schema.
The string that the MQTT broker uses to filter messages for each connected
client. By default, the topic is set to "device/[device]"
, where [device]
is
the DeviceUID. Learn more about
substitution variables.
certificate
string
Only applies to "mqtt" route schema.
The SSL certificate with \n
for new lines.
certificate
_name
string
Only applies to "mqtt" route schema.
The name of the SSL certificate.
key
string
Only applies to "mqtt" route schema.
The SSL certificate key with `\n\ for new lines.
private
_key
_name
string
Only applies to "mqtt" route schema.
The name of the SSL certificate key.
test_api
boolean
Only applies to "radresponder" route schema.
Whether or not to enable RadResponder test site.
data_feed_key
string
Only applies to "radresponder" route schema.
The key for the RadResponder data feed.
client_id
string
Only applies to "radresponder" route schema.
The RadResponder client ID.
client
_secret
string
Only applies to "radresponder" route schema.
The RadResponder client secret.
org_name
string
Only applies to "snowflake" route schema.
The unique organization name set at the time when the Snowflake account was provisioned.
account_name
string
Only applies to "snowflake" route schema.
The unique (within the organization) name of the Snowflake account.
user_name
string
Only applies to "snowflake" route schema.
The username of the Snowflake account.
private
_key
_name
string
Only applies to "snowflake" route schema.
The name of the PEM key.
pem
string
Only applies to "snowflake" route schema.
The PEM with with \n
for new lines.
account_sid
string
Only applies to "twilio" route schema.
The Twilio account SID.
auth_token
string
Only applies to "twilio" route schema.
The Twilio Auth Token.
to
string
Only applies to "twilio" route schema.
The phone number the SMS is sent to (must use the
E.164 format). If blank, uses
the twilioTo
field value from the Note body
.
from
string
Only applies to "twilio" route schema.
The phone number the SMS is sent from (must use the
E.164 format). If blank, uses
the twilioFrom
field value from the Note body
.
message
string
Only applies to "twilio" route schema.
The SMS message to send. If blank, uses the twilioBody
field value from the
Note body
.
curl -X POST -L 'https://api.notefile.net/v1/projects/<projectUID>/routes' -H 'Authorization: Bearer <access_token>' -d '{ "label":"<label>", "type":"<type>", "<schema>":{ "url":"<url>" } }'
Response Members
uid
string
The globally-unique identifier of the route.
label
string
The name of the route.
type
string
The service to which this route connects (see above for a full list of route types).
modified
string
The date and time this route was last modified.
disabled
boolean
Whether or not this route is disabled.
schema
object
Additional meta data specific to the type of route (see request members from Create Route for a complete list).
{ "uid": "route:0ac565deb7b478a250bb82347b9cfdd2", "label": "My HTTP Route", "type": "http", "modified": "2020-03-09T17:58:36Z", "disabled": false, "http": { "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"], "filter": { "type": "", "system_notefiles": false }, "transform": {}, "throttle_ms": 100, "url": "http://route.url", "http_headers": null, "disable_http_headers": false, "timeout": 0 } }
Update Route by UID
Update a route by its RouteUID.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
routeUID
string
The RouteUID of a route.
object
object
Additional meta data specific to the type of route (see request members from Create Route for a complete list).
curl -X PUT -L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>' -H 'Authorization: Bearer <access_token>' -d '{ "label":"<label>", "type":"<type>", "<schema>":{ "url":"<url>" } }'
Response Members
uid
string
The globally-unique identifier of the route.
label
string
The name of the route.
type
string
The service to which this route connects (see above for a full list of route types).
modified
string
The date and time this route was last modified.
disabled
boolean
Whether or not this route is disabled.
schema
object
Additional meta data specific to the type of route (see request members from Create Route for a complete list).
{ "uid": "route:0ac565deb7b478a250bb82347b9cfdd2", "label": "My HTTP Route", "type": "http", "modified": "2020-03-09T17:58:36Z", "disabled": false, "http": { "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"], "filter": { "type": "", "system_notefiles": false }, "transform": {}, "throttle_ms": 100, "url": "http://route.url", "http_headers": null, "disable_http_headers": false, "timeout": 0 } }
Delete Route by UID
Delete a single route by its RouteUID.
Minimum Notehub project-level role required:
access_token
string
A Notehub API bearer token.
projectUID
string
The ProjectUID from a Notehub project.
routeUID
string
The RouteUID of a route.
curl -X DELETE -L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>' -H 'Authorization: Bearer <access_token>'