Route API
The Notehub route API provides RESTful methods that can be used to GET
, PUT
,
POST
, and DELETE
Notehub routes.
Name | HTTP Request |
---|---|
Get Routes | GET /v1/projects/{projectUID}/routes |
Get Route | GET /v1/projects/{projectUID}/routes/{routeUID} |
Get Route Logs | GET /v1/projects/{projectUID}/routes/{routeUID}/route-logs |
Create Route | POST /v1/projects/{projectUID}/routes |
Delete Route | DELETE /v1/projects/{projectUID}/routes/{routeUID} |
Update Route | PUT /v1/projects/{projectUID}/routes/{routeUID} |
Get Routes Notehub
Get an array of routes associated with a Notehub project.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/routes |
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>/routes'
-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.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getRoutes(projectUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
import notehub_py
from notehub_py.models.user_db_route import UserDbRoute
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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_routes(project_uid)
print("The response of RouteApi->get_routes:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->get_routes: %s\n" % e)
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 Notehub
Get a single route by its RouteUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/routes/{routeUID} |
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>/routes/<routeUID>'
-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.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
apiInstance.getRoute(projectUID, routeUID).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str |
try:
api_response = api_instance.get_route(project_uid, route_uid)
print("The response of RouteApi->get_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->get_route: %s\n" % e)
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
}
}
Get Route Logs Notehub
Get an array of route logs associated with a Notehub project.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>/route-logs |
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. |
pageSize
integer (optional)
Specifies the number of events to be returned by a request (default 50).
pageNum
integer (optional)
Specifies the page number of the results returned (useful when the pageSize
is
less than the total number of sessions that could be returned).
deviceUID
string (optional)
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
.
sortBy
string (optional)
Specifies a field in the result set to sort by, and must be one of the
following: best_id
, device_serial
, device_uid
, captured
,
modified
, device_location
, tower_location
,
triangulated_location
, best_location
.
sortOrder
string (optional)
Specifies the ascending (asc
) or descending (desc
) order of the result set
when paired with sortBy
. The default is asc
.
startDate
UNIX Epoch time (optional)
The start date/time stamp of the events to be returned.
endDate
UNIX Epoch time (optional)
The end date/time stamp of the events to be returned.
systemFilesOnly
boolean (optional)
If true
, will only return System Notefiles in
the response.
files
string (optional)
A comma-delimited list of Notefile(s) this request should return events from.
For example, setting this argument to track.qo,sensor.qo
would return events
only from the track.qo
and sensor.qo
Notefiles.
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>/route-logs'
-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.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let opts = {
pageSize: 50, // Number |
pageNum: 1, // Number |
deviceUID: ["null"], // [String] | A Device UID.
sortBy: "captured", // String |
sortOrder: "asc", // String |
startDate: 1628631763, // Number | Unix timestamp
endDate: 1657894210, // Number | Unix timestamp
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo" // String |
};
apiInstance.getRouteLogsByRoute(projectUID, routeUID, opts).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
import notehub_py
from notehub_py.models.get_route_logs_by_route200_response_inner import GetRouteLogsByRoute200ResponseInner
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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
sort_by = "captured" # str | (optional) (default to "captured")
sort_order = "asc" # str | (optional) (default to "asc")
start_date = 1628631763 # int | Unix timestamp (optional)
end_date = 1657894210 # int | Unix timestamp (optional)
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
try:
api_response = api_instance.get_route_logs_by_route(project_uid, route_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, system_files_only=system_files_only, files=files)
print("The response of RouteApi->get_route_logs_by_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->get_route_logs_by_route: %s\n" % e)
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>/route-logs?pageSize=<pageSize>&pageNum=<pageNum>&deviceUID=<deviceUID>&sortBy=<sortBy>&sortOrder=<sortOrder>&startDate=<startDate>&endDate=<endDate>&systemFilesOnly=<systemFilesOnly>&files=<files>'
-H 'Authorization: Bearer <access_token>'
Response Members
date
string
The date/time stamp of the log entry.
routeUID
string
The globally-unique identifier of the route.
eventUID
string
The globally-unique identifier of the event.
attn
boolean
Whether the event was routed in error.
status
string
The status of the event.
text
string
The response body of the route.
[
{
"date": "2023-05-06T05:40:51.80559Z",
"routeUID": "app:4be5d3ac-998a-44f0-8ecd-6bd716858b3d/route:d632e16fc956162ae3db4f20ddacc2b8",
"eventUID": "5ee2e385-e282-476e-afec-327498fe91a3",
"attn": false,
"status": "200",
"text": "thanks"
},
{
"date": "2023-05-06T05:40:51.318522Z",
"routeUID": "app:4be5d3ac-998a-44f0-8ecd-6bd716858b3d/route:d632e16fc956162ae3db4f20ddacc2b8",
"eventUID": "4fb2c905-080a-40c5-96f7-d8193fa18116",
"attn": false,
"status": "200",
"text": "thanks"
}
]
Create Route Notehub
Create a new route within a Notehub project.
HTTP Method: | POST |
URL: | https://api.notefile.net/v1/projects/{projectUID}/routes |
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 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", "slack-bearer", "slack-webhook".
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", "slack".
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.
token
string
Only applies to "google-function" route schema.
An optional authentication token for the Google Cloud Function.
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-iot-analytics" and "slack-bearer" route types.
The AWS IoT Analytics channel or the Channel ID for Slack bearer token route.
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
.
slack_type
string
Only applies to "slack" route schema.
The type of Slack message. Must be one of "slack-bearer"
for bearer token or
"slack-webhook"
for webhook messages.
bearer
string
Only applies to "slack-bearer" route type.
The bearer token for Slack messaging, for example:
xoxb-1234-56789abcdefghijklmnop
.
webhook_url
string
Only applies to "slack-webhook" route type.
The webhook URL for Slack messaging, for example:
https://hooks.slack.com/services/FOO4BAR/THIS4THAT/123xYzaBC456
.
text
string
Only applies to "slack" route schema.
The simple text message to be sent, if the blocks
message field is not in use.
blocks
string
Only applies to "slack" route schema.
The Slack Blocks message to be sent. If populated, this field overrides the text field within the Slack Messaging API.
alias
string
Only applies to "proxy" route schema.
The alias for a proxy route in Notehub.
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>"
}
}'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let notehubRoute = {
label: "Route Label",
type: "http",
http: {
fleets: ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
throttle_ms: 100,
url: "http://route.url",
},
}; // NotehubRoute | Route to be Created
apiInstance.createRoute(projectUID, notehubRoute).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
notehub_route = {
"label": "Route Label",
"type":"http",
"http": {
"fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
"throttle_ms": 100,
"url": "http://route.url"
}
}
# NotehubRoute | Route to be Created
try:
api_response = api_instance.create_route(project_uid, notehub_route)
print("The response of RouteApi->create_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->create_route: %s\n" % e)
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 Notehub
Delete a single route by its RouteUID.
HTTP Method: | DELETE |
URL: | https://api.notefile.net/v1/projects/{projectUID}/routes/{routeUID} |
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. |
access_token
curl -X DELETE
-L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>'
-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.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
apiInstance.deleteRoute(projectUID, routeUID).then((data) => {
console.log("API called successfully. Returned data: " + JSON.stringify(data));
}, (error) => {
console.error(error);
});
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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str |
try:
api_response = api_instance.delete_route(project_uid, route_uid)
print("The response of RouteApi->delete_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->delete_route: %s\n" % e)
Update Route Notehub
Update a route by its RouteUID.
HTTP Method: | PUT |
URL: | https://api.notefile.net/v1/projects/{projectUID}/routes/{routeUID} |
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. |
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>"
}
}'
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications["api_key"];
api_key.apiKey = "YOUR API KEY";
let apiInstance = new NotehubJs.RouteApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let notehubRoute = {
http: {
filter: {
type: "include",
system_notefiles: true,
files: ["somefile.qo"]
},
throttle_ms: 50,
url: "http://new-route.url",
},
}; // NotehubRoute | Route settings to be updated
apiInstance.updateRoute(projectUID, routeUID, notehubRoute).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
},
(error) => {
console.error(error);
}
);
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str |
notehub_route = {
"http" {
"filter": {
"type": "include",
"system_notefiles": true,
"files": ["somefile.qo"],
},
"throttle_ms": 50,
"url": "http://new-route.url",
},
}
# NotehubRoute | Route settings to be updated
try:
api_response = api_instance.update_route(project_uid, route_uid, notehub_route)
print("The response of RouteApi->update_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->update_route: %s\n" % e)
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
}
}