Event API
The Notehub event API provides RESTful methods that can be used to GET
event
data.
Name | HTTP Request |
---|---|
Get Project Events | GET /v1/projects/{projectUID}/events |
Get Project Events by Cursor | GET /v1/projects/{projectUID}/events-cursor |
Get Fleet Events | GET /v1/projects/{projectUID}/fleets/{fleetUID}/events |
Get Fleet Events by Cursor | GET /v1/projects/{projectUID}/fleets/{fleetUID}/events-cursor |
Get Route Logs by Event | GET /v1/projects/{projectUID}/events/{eventUID}/route-logs |
Get Project Events Notehub
Get an array of Notehub events by ProjectUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/<projectUID>/events |
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. |
This API reference displays all possible fields that can be present in an event response. However, certain fields will only be present for certain types of events (e.g. Note added event, Note updated event, .dbs update event, Notehub session event, etc).
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). When provided,
the pageNum
must be >= 1
.
deviceUID
Array (optional)
An array of DeviceUIDs of Notehub devices.
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.
dateType
string (optional)
Which date to filter on, either captured
or uploaded
. This will apply to the startDate
and endDate
parameters.
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.
format
string (optional)
Response format ("json" or "csv").
serialNumber
Array (optional)
An array of device serial numbers to filter by.
fleetUID
Array (optional)
An array of FleetUIDs to filter by.
sessionUID
Array (optional)
An array of SessionUIDs to filter by.
eventUID
Array (optional)
An array of EventUIDs to filter by.
selectFields
string (optional)
Comma-separated list of fields to include in the response (e.g., "field1,field2.subfield,field3").
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/events'
-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.EventApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // 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
dateType: "uploaded", // String | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
format: "json", // String | Response format (JSON or CSV)
serialNumber: ["null"], // [String] | Filter by Serial Number
fleetUID: ["null"], // [String] | Filter by Fleet UID
sessionUID: ["null"], // [String] | Filter by Session UID
eventUID: ["null"], // [String] | Filter by Event UID
selectFields: "selectFields_example", // String | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output.
deviceUIDs: ["null"], // [String] | Deprecated.
since: "since_example" // String | Deprecated.
};
apiInstance.getProjectEvents(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.get_project_events200_response import GetProjectEvents200Response
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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # 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)
date_type = "captured" # str | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters (optional) (default to 'captured')
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
format = "json" # str | Response format (JSON or CSV) (optional) (default to 'json')
serial_number = ["serial_number_example"] # List[str] | Filter by Serial Number (optional)
fleet_uid = ["fleet_uid_example"] # List[str] | Filter by Fleet UID (optional)
session_uid = ["session_uid_example"] # List[str] | Filter by Session UID (optional)
event_uid = ["event_uid_example"] # List[str] | Filter by Event UID (optional)
select_fields ="select_fields_example" # str | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output. (optional)
device_uids = ["device_uids_example"] # List[str] | Deprecated. (optional)
since = "since_example" # str | Deprecated. (optional)
try:
api_response = api_instance.get_project_events(project_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, date_type=date_type, system_files_only=system_files_only, files=files, format=format, serial_number=serial_number, fleet_uid=fleet_uid, session_uid=session_uid, event_uid=event_uid, select_fields=select_fields, device_uids=device_uids, since=since)
print("The response of EventApi->get_project_events:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_project_events: %s\n" % e)
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/events?pageSize=<pageSize>&pageNum=<pageNum>&deviceUID=<deviceUID>&sortBy=<sortBy>&sortOrder=<sortOrder>&startDate=<startDate>&endDate=<endDate>&dateType=<dateType>&systemFilesOnly=<systemFilesOnly>&files=<files>&format=<format>&serialNumber=<serialNumber>&fleetUID=<fleetUID>&sessionUID=<sessionUID>&eventUID=<eventUID>&selectFields=<selectFields>'
-H 'Authorization: Bearer <access_token>'
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/events?files=track.qo,sensor.qo'
-H 'Authorization: Bearer <access_token>'
Response Members
event
string
The globally-unique EventUID.
session
string
The globally-unique SessionUID for the device's current Notehub session.
best_id
string
The device's best identifier. This is the device's serial number if set, or the device's DeviceUID if not.
device
string
The device's globally-unique DeviceUID.
sn
string
The device's serial number.
product
string
The globally-unique ProductUID.
app
string
The globally-unique AppUID for the device's current Notehub application.
received
UNIX Epoch time
The date and time this event was received by Notehub.
req
string
The API command used to create this event.
when
UNIX Epoch time
The date and time this event was captured by the device.
file
string
The name of the Notefile.
updates
number
The number of updates performed on a DB Notefile.
body
object
A JSON object containing the event details.
best_location_type
string
The type of location used as for all the "best"
response fields, either
"gps"
, "triangulated"
, or "tower"
.
best_location_when
UNIX Epoch time
The date and time the device last determined its location.
A device can have its location determined by GPS/GNSS, triangulation, or from the
cell tower that received the event. The best_*
fields provide the most accurate
values from the available locations.
best_lat
number
The latitude of the device that sent the event.
A device can have its location determined by GPS/GNSS, triangulation, or from the
cell tower that received the event. The best_*
fields provide the most accurate
values from the available locations.
best_lon
number
The longitude of the device that sent the event.
A device can have its location determined by GPS/GNSS, triangulation, or from the
cell tower that received the event. The best_*
fields provide the most accurate
values from the available locations.
best_location
string
The name of the location from the device that sent the event.
A device can have its location determined by GPS/GNSS, triangulation, or from the
cell tower that received the event. The best_*
fields provide the most accurate
values from the available locations.
best_country
string
The country of the device that sent the event.
A device can have its location determined by GPS/GNSS, triangulation, or from the
cell tower that received the event. The best_*
fields provide the most accurate
values from the available locations.
best_timezone
string
The timezone of the location from the device that sent the event.
A device can have its location determined by GPS/GNSS, triangulation, or from the
cell tower that received the event. The best_*
fields provide the most accurate
values from the available locations.
tower_id
string
A combination of the mcc
, mnc
, lac
, and cid
values, denoting the cell
tower where the session originated.
tower_country
string
The country of the physical cell tower that received the event.
tower_lat
number
The latitude of the physical cell tower that received the event.
tower_lon
number
The longitude of the physical cell tower that received the event.
tower_location
string
The name of the location of the physical cell tower that received the event.
tower_timezone
string
The timezone used by the physical cell tower that received the event.
tower_when
UNIX Epoch time
The date and time the device retrieved the tower location.
tri_when
UNIX Epoch time
The date and time when the device retrieved its triangulated location.
tri_lat
number
The latitude of the device's triangulated location when it sent the event.
tri_lon
number
The longitude of the device's triangulated location when it sent the event.
tri_location
string
The name of the device's triangulated location when it sent the event.
tri_country
string
The country of the device's triangulated location when it sent the event.
tri_timezone
string
The timezone of the device's triangulated location when it sent the event.
tri_points
number
The number of Wi-Fi access points (if using Wi-Fi triangulation) or cell towers (if using cell-tower triangulation) used to determine the triangulated location.
where_country
string
The country from the device's GPS/GNSS location when it sent the event.
where_lat
number
The latitude from the device's GPS/GNSS location when it sent the event.
where_lon
number
The longitude from the device's GPS/GNSS location when it sent the event.
where_location
string
The name of the device's GPS/GNSS location when it sent the event.
where_timezone
string
The timezone from the device's GPS/GNSS location when it sent the event.
where_when
UNIX Epoch time
The date and time when the device last determined its GPS/GNSS location.
has_more
boolean
Defines whether or not there are additional events beyond this list.
{
"events": [
{
"event": "dfa3747d-688b-4250-935b-5dd60354313c",
"session": "b623132c-6afb-4740-bc39-e3634e38f064",
"best_id": "My Device",
"device": "dev:5c0272311928",
"sn": "My Device",
"product": "product:com.blues.project.demo",
"app": "app:3733f429-9335-6756-3456-c397c0000000",
"received": 1656011227.006928,
"req": "note.add",
"when": 1656010061,
"file": "203733583236500300070022#air.qo",
"updates": 1,
"body": {
"humidity": 40.375,
"pressure": 97705.66,
"temperature": 24.0625,
"voltage": 2.598
},
"best_location_type": "triangulated",
"best_location_when": 1652709545,
"best_lat": 34.82476372,
"best_lon": -83.32261614,
"best_location": "Atlanta GA",
"best_country": "US",
"best_timezone": "America/New_York",
"tower_id": "0,0,0,0",
"tri_when": 1652709545,
"tri_lat": 34.82475372,
"tri_lon": -83.32261614,
"tri_location": "Atlanta GA",
"tri_country": "US",
"tri_timezone": "America/New_York",
"tri_points": 6
}
],
"has_more": false
}
Get Project Events by Cursor Notehub
Get an array of Notehub events by ProjectUID and cursor (i.e. a means of limiting your result set).
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/events-cursor |
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. |
This API reference displays all possible fields that can be present in an event response. However, certain fields will only be present for certain types of events (e.g. Note added event, Note updated event, .dbs update event, Notehub session event, etc).
fleetUID
string (optional)
The FleetUID of a Notehub device fleet.
deviceUID
array (optional)
An array of DeviceUIDs of Notehub devices.
You may alternatively provide a device serial number by prefixing this argument
with sn:
, for example sn:my-device
.
limit
integer (optional)
The number of records to return (minimum value is 1
). Default value is 50
.
cursor
string (optional)
The globally-unique EventUID obtained from the
next_cursor
value from a previous call to this API. The result set will
include this event as its first result. However, if the provided EventUID is not
valid, this parameter is ignored.
sortOrder
string (optional)
Specifies the ascending (asc
) or descending (desc
) order of the result set
based on the timestamp at which the event was received in Notehub. The default
is asc
.
systemFilesOnly
boolean (optional)
If true
, will only return System Notefiles in
the response.
files
string (optional)
Limit the query to return only the Notefile(s) named in this argument (e.g.
&files=track.qo,sensor.qo
).
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/events-cursor
-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.EventApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
limit: 50, // Number |
cursor: "cursor_example", // String | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.
sortOrder: "asc", // String |
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
fleetUID: "fleetUID_example", // String | A Fleet UID.
deviceUID: ["null"] // [String] | A Device UID.
};
apiInstance.getProjectEventsByCursor(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.get_project_events_by_cursor200_response import GetProjectEventsByCursor200Response
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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
limit = 50 # int | (optional) (default to 50)
cursor = "cursor_example" # str | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. (optional)
sort_order = "asc" # str | (optional) (default to "asc")
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
fleet_uid = "fleet_uid_example" # str | (optional)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
try:
api_response = api_instance.get_project_events_by_cursor(project_uid, limit=limit, cursor=cursor, sort_order=sort_order, system_files_only=system_files_only, files=files, fleet_uid=fleet_uid, device_uid=device_uid)
print("The response of EventApi->get_project_events_by_cursor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_project_events_by_cursor: %s\n" % e)
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/events-cursor?fleetUID=<fleetUID>&deviceUID=<deviceUID>&limit=<limit>&cursor=<cursor>&sortOrder=<sortOrder>&systemFilesOnly=<systemFilesOnly>&files=<files>'
-H 'Authorization: Bearer <access_token>'
Response Members
events
array
An array of events (see the Get Project Events response for a full description of the data elements returned).
next_cursor
string
The cursor value of the next EventUID, which is
intended to be used as the cursor
parameter of the subsequent call to this
API. An empty string is returned if there are no additional results to display.
has_more
boolean
Defines whether or not there are additional events beyond this list.
{
"events": [
{
"event": "dfa3747d-688b-4250-935b-5dd60354313c",
"session": "b623132c-6afb-4740-bc39-e3634e38f064",
"best_id": "My Device",
"device": "dev:5c0272311928",
"sn": "My Device",
"product": "product:com.blues.project:demo",
"app": "app:3733f429-9335-6756-3456-c397c0000000",
"received": 1656011227.006928,
"req": "note.add",
"when": 1656010061,
"file": "203733583236500300070022#air.qo",
"updates": 1,
"body": {
"humidity": 40.375,
"pressure": 97705.66,
"temperature": 24.0625,
"voltage": 2.598
},
"best_location_type": "triangulated",
"best_location_when": 1652709545,
"best_lat": 34.82476372,
"best_lon": -83.32261614,
"best_location": "Atlanta GA",
"best_country": "US",
"best_timezone": "America/New_York",
"tower_id": "0,0,0,0",
"tri_when": 1652709545,
"tri_lat": 34.82475372,
"tri_lon": -83.32261614,
"tri_location": "Atlanta GA",
"tri_country": "US",
"tri_timezone": "America/New_York",
"tri_points": 6
}
],
"next_cursor": "00000000-0000-0000-0000-000000000000",
"has_more": false
}
Get Fleet Events Notehub
Get an array of Notehub events by FleetUID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/<projectUID>/events/fleets/<fleetUID>/events |
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. |
This API reference displays all possible fields that can be present in an event response. However, certain fields will only be present for certain types of events (e.g. Note added event, Note updated event, .dbs update event, Notehub session event, etc).
fleetUID
array (optional)
An array of FleetUIDs to filter events by.
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). When provided,
the pageNum
must be >= 1
.
deviceUID
array (optional)
An array of DeviceUIDs to filter events by.
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.
dateType
string (optional)
Which date to filter on, either captured
or uploaded
. This will apply to the startDate
and endDate
parameters.
systemFilesOnly
boolean (optional)
If true
, will only return System Notefiles in
the response.
files
string (optional)
Limit the query to return only the Notefile(s) named in this argument (e.g.
&files=track.qo,sensor.qo
).
format
string (optional)
Response format ("json" or "csv").
serialNumber
array (optional)
An array of serial numbers to filter events by.
sessionUID
array (optional)
An array of SessionUIDs to filter events by.
eventUID
array (optional)
An array of EventUIDs to filter events by.
selectFields
string (optional)
Comma-separated list of fields to include in the response (e.g., "field1,field2.subfield,field3").
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/events'
-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.EventApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // 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
dateType: "uploaded", // String | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
format: "json", // String | Response format (JSON or CSV)
serialNumber: ["null"], // [String] | Filter by Serial Number
sessionUID: ["null"], // [String] | Filter by Session UID
eventUID: ["null"], // [String] | Filter by Event UID
selectFields: "selectFields_example", // String | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output.
deviceUIDs: ["null"], // [String] | Deprecated.
since: "since_example" // String | Deprecated.
};
apiInstance.getFleetEvents(projectUID, fleetUID, 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_project_events200_response import GetProjectEvents200Response
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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # 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)
date_type = "captured" # str | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters (optional) (default to 'captured')
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
format = "json" # str | Response format (JSON or CSV) (optional) (default to 'json')
serial_number = ["serial_number_example"] # List[str] | Filter by Serial Number (optional)
session_uid = ["session_uid_example"] # List[str] | Filter by Session UID (optional)
event_uid = ["event_uid_example"] # List[str] | Filter by Event UID (optional)
select_fields = "select_fields_example" # str | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output. (optional)
device_uids = ["device_uids_example"] # List[str] | Deprecated. (optional)
since = "since_example" # str | Deprecated. (optional)
try:
api_response = api_instance.get_fleet_events(project_uid, fleet_uid=fleet_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, date_type=date_type, system_files_only=system_files_only, files=files, format=format, serial_number=serial_number, session_uid=session_uid, event_uid=event_uid, select_fields=select_fields, device_uids=device_uids, since=since)
print("The response of EventApi->get_fleet_events:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_fleet_events: %s\n" % e)
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/events?pageSize=<pageSize>&pageNum=<pageNum>&deviceUID=<deviceUID>&sortBy=<sortBy>&sortOrder=<sortOrder>&startDate=<startDate>&endDate=<endDate>&systemFilesOnly=<systemFilesOnly>&files=<files>&format=<format>&serialNumber=<serialNumber>&sessionUID=<sessionUID>&eventUID=<eventUID>&selectFields=<selectFields>'
-H 'Authorization: Bearer <access_token>'
Response Members
events
array
An array of events (see the Get Project Events response for a full description of the data elements returned).
through
string
The globally-unique identifier of the last event in the array.
has_more
boolean
Defines whether or not there are additional events beyond this list.
{
"events": [
{
"event": "dfa3747d-688b-4250-935b-5dd60354313c",
"session": "b623132c-6afb-4740-bc39-e3634e38f064",
"best_id": "My Device",
"device": "dev:5c0272311928",
"sn": "My Device",
"product": "product:com.blues.project.demo",
"app": "app:3733f429-9335-6756-3456-c397c0000000",
"received": 1656011227.006928,
"req": "note.add",
"when": 1656010061,
"file": "203733583236500300070022#air.qo",
"updates": 1,
"body": {
"humidity": 40.375,
"pressure": 97705.66,
"temperature": 24.0625,
"voltage": 2.598
},
"best_location_type": "triangulated",
"best_location_when": 1652709545,
"best_lat": 34.82476372,
"best_lon": -83.32261614,
"best_location": "Atlanta GA",
"best_country": "US",
"best_timezone": "America/New_York",
"tower_id": "0,0,0,0",
"tri_when": 1652709545,
"tri_lat": 34.82475372,
"tri_lon": -83.32261614,
"tri_location": "Atlanta GA",
"tri_country": "US",
"tri_timezone": "America/New_York",
"tri_points": 6
}
],
"through": "dfa3747d-688b-4250-935b-5dd60354313c",
"has_more": false
}
Get Fleet Events by Cursor Notehub
Get an array of Notehub events by FleetUID and cursor (i.e. a means of limiting your result set).
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/fleets/{fleetUID}/events-cursor |
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. |
This API reference displays all possible fields that can be present in an event response. However, certain fields will only be present for certain types of events (e.g. Note added event, Note updated event, .dbs update event, Notehub session event, etc).
limit
integer (optional)
The number of records to return (minimum value is 1
). Default value is 50
.
cursor
string (optional)
The globally-unique EventUID obtained from the
next_cursor
value from a previous call to this API. The result set will
include this event as its first result. However, if the provided EventUID is not
valid, this parameter is ignored.
sortOrder
string (optional)
Specifies the ascending (asc
) or descending (desc
) order of the result set
based on the timestamp at which the event was received in Notehub. The default
is asc
.
systemFilesOnly
boolean (optional)
If true
, will only return System Notefiles in
the response.
files
string (optional)
Limit the query to return only the Notefile(s) named in this argument (e.g.
&files=track.qo,sensor.qo
).
deviceUID
array (optional)
An array of DeviceUIDs of Notehub devices.
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.
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/events-cursor?limit=<limit>&cursor=<cursor>&sortOrder=<sortOrder>&systemFilesOnly=<systemFilesOnly>&files=<files>&deviceUID=<deviceUID>&startDate=<startDate>&endDate=<endDate>'
-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.EventApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
limit: 50, // Number |
cursor: "cursor_example", // String | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.
sortOrder: "asc", // String |
systemFilesOnly: true, // Boolean |
files: "_health.qo, data.qo", // String |
deviceUID: ["null"], // [String] | A Device UID.
startDate: 1628631763, // Number | Unix timestamp
endDate: 1657894210 // Number | Unix timestamp
};
apiInstance.getFleetEventsByCursor(projectUID, fleetUID, 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_project_events_by_cursor200_response import GetProjectEventsByCursor200Response
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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
limit = 50 # int | (optional) (default to 50)
cursor = "cursor_example" # str | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. (optional)
sort_order = "asc" # str | (optional) (default to "asc")
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
device_uid = ["device_uid_example"] # str | A Device UID. (optional)
start_date = 1628631763 # int | Unix timestamp (optional)
end_date = 1657894210 # int | Unix timestamp (optional)
try:
api_response = api_instance.get_fleet_events_by_cursor(project_uid, fleet_uid, limit=limit, cursor=cursor, sort_order=sort_order, system_files_only=system_files_only, files=files, device_uid=device_uid, start_date=start_date, end_date=end_date)
print("The response of EventApi->get_fleet_events_by_cursor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_fleet_events_by_cursor: %s\n" % e)
Response Members
events
array
An array of events (see the Get Project Events response for a full description of the data elements returned).
next_cursor
string
The globally-unique identifier of the last event in the array.
has_more
boolean
Defines whether or not there are additional events beyond this list.
{
"events": [
{
"event": "dfa3747d-688b-4250-935b-5dd60354313c",
"session": "b623132c-6afb-4740-bc39-e3634e38f064",
"best_id": "My Device",
"device": "dev:5c0272311928",
"sn": "My Device",
"product": "product:com.blues.project.demo",
"app": "app:3733f429-9335-6756-3456-c397c0000000",
"received": 1656011227.006928,
"req": "note.add",
"when": 1656010061,
"file": "203733583236500300070022#air.qo",
"updates": 1,
"body": {
"humidity": 40.375,
"pressure": 97705.66,
"temperature": 24.0625,
"voltage": 2.598
},
"best_location_type": "triangulated",
"best_location_when": 1652709545,
"best_lat": 34.82476372,
"best_lon": -83.32261614,
"best_location": "Atlanta GA",
"best_country": "US",
"best_timezone": "America/New_York",
"tower_id": "0,0,0,0",
"tri_when": 1652709545,
"tri_lat": 34.82475372,
"tri_lon": -83.32261614,
"tri_location": "Atlanta GA",
"tri_country": "US",
"tri_timezone": "America/New_York",
"tri_points": 6
}
],
"next_cursor": "00000000-0000-0000-0000-000000000000",
"has_more": false
}
Get Route Logs by Event Notehub
Get an array of route logs associated with a Notehub project by event UID.
HTTP Method: | GET |
URL: | https://api.notefile.net/v1/projects/{projectUID}/events/{eventUID}/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. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectUID>/events/<eventUID>/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.EventApi();
let projectUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let eventUID = "4506f411-dea6-44a0-9743-1130f57d7747"; // String |
apiInstance.getRouteLogsByEvent(projectUID, eventUID).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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
event_uid = "4506f411-dea6-44a0-9743-1130f57d7747" # str |
try:
api_response = api_instance.get_route_logs_by_event(project_uid, event_uid)
print("The response of EventApi->get_route_logs_by_event:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_route_logs_by_event: %s\n" % e)
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-08-07T17:29:21.677934Z",
"routeUID": "app:4be5d3ac-998a-44f0-8ecd-6bd716858b3c/route:d632e16fc956162ae3db4f20ddacc2b1",
"eventUID": "cccd9b22-b156-47ee-b399-bf7e1c45d5f0",
"attn": false,
"status": "200",
"text": "thanks"
}
]