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/{projectOrProductUID}/events |
| Get Project Events by Cursor Deprecated | GET /v1/projects/{projectOrProductUID}/events-cursor |
| Get Fleet Events | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events |
| Get Fleet Events by Cursor Deprecated | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor |
| Get Route Logs by Event | GET /v1/projects/{projectOrProductUID}/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/<projectOrProductUID>/events |
| Path Parameters: |
|
| Minimum Notehub project-level role: | viewer |
| Required HTTP Headers: | Authorization: Bearer <token>, where the token is a valid authentication 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.
cursor
string (optional)
Use this to retrieve events in batches, ordered by when each event was last
created or updated in Notehub (oldest first). Each response includes has_more,
which is true if there are more events to retrieve, and a next_cursor value
to pass as the cursor of your next request to get the next batch. Set cursor
to:
0to start from the beginning.- A Unix epoch time in microseconds (UTC) to retrieve only events last changed at or after that time.
- The
next_cursorvalue returned by a previous request, to pick up where that request left off.
When format is csv, the response body is plain CSV rows with no room for
has_more or next_cursor, so read them from the X-Has-More and
X-Next-Cursor response headers instead.
cursor cannot be combined with pageNum, sortBy, or sortOrder.
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)
Start date for filtering results, specified as a Unix timestamp.
endDate
UNIX Epoch time (optional)
End date for filtering results, specified as a Unix timestamp.
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/<projectOrProductUID>/events'
-H 'Authorization: Bearer <access_token>'import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8";
let opts = {
pageSize: 50,
pageNum: 1,
};
apiInstance.getEvents(projectOrProductUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data),
);
},
(error) => {
console.error(error);
},
);import os
from pprint import pprint
import notehub_py
configuration = notehub_py.Configuration(
access_token=os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
api_instance = notehub_py.EventApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8"
try:
api_response = api_instance.get_events(
project_or_product_uid, page_size=50, page_num=1
)
print("The response of EventApi->get_events:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_events: %s\n" % e)curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/events?pageSize=<pageSize>&pageNum=<pageNum>&cursor=<cursor>&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/<projectOrProductUID>/events?files=track.qo,sensor.qo'
-H 'Authorization: Bearer <access_token>'Response Members
event
string
The globally-unique EventUID.
deleted
boolean (optional)
true if this event has been deleted. Only present when reading with a cursor.
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
integer
The number of updates performed on a DB Notefile.
body
object
A JSON object containing the event details.
wire_length
integer (optional)
The approximate number of bytes that the Note's body and payload occupied on the wire when transmitted from the device to Notehub. This member is only present on events that originate from a device, and is omitted for events created by the Notehub API and Notehub itself.
platform
boolean (optional)
Whether this is a platform event. This member is omitted for non-platform events.
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
float
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
float
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
float
The latitude of the physical cell tower that received the event.
tower_lon
float
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
float
The latitude of the device's triangulated location when it sent the event.
tri_lon
float
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
integer
The number of WiFi access points (if using WiFi 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
float
The latitude from the device's GPS/GNSS location when it sent the event.
where_lon
float
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.
rssi
integer
Received Signal Strength Indicator (RSSI) is an estimated measurement of how
well a device can receive signals. Only available on _session.qo events.
sinr
integer
The Signal to Interference plus Noise Ratio (SINR) of the cell tower that
received the event. Only available on _session.qo events.
rsrp
integer
The Reference Signal Received Power (RSRP) of the cell tower that received the
event. Only available on _session.qo events.
rsrq
integer
The Reference Signal Received Quality (RSRQ) of the cell tower that received the
event. Only available on _session.qo events.
rat
string
The Radio Access Technology (RAT) of the cell tower that received the event. Only
available on _session.qo events.
bars
integer
The number of signal bars of the cell tower that received the event. Only
available on _session.qo events.
voltage
float
The battery voltage of the device when it sent the event. Only available on
_session.qo events.
temp
float
The temperature of the device when it sent the event. Only available on
_session.qo events.
sku
string
The SKU of the device that sent the event. Only available on _session.qo events.
ordering_code
string
The ordering code of the device that sent the event. Only available on
_session.qo events.
ssid
string
The Service Set Identifier (SSID) of the WiFi network the device was connected
to when it sent the event. Only available on _session.qo events.
bssid
string
The Basic Service Set Identifier (BSSID) of the WiFi network the device was
connected to when it sent the event. Only available on _session.qo events.
has_more
boolean
Defines whether or not there are additional events beyond this list.
next_cursor
string (optional)
A marker for where this batch of events ended. Pass it, exactly as returned, as
the cursor argument of your next request to get the next batch. It's returned
even when has_more is false, so once you've caught up you can keep using it
to retrieve only the events that have changed since. When format is csv,
read this value from the X-Next-Cursor response header instead. Only returned
when the request includes a cursor.
{
"events": [
{
"event": "dfa3747d-688b-4250-935b-5dd60354313c",
"session": "b623132c-6afb-4740-bc39-e3634e38f064",
"best_id": "My Device",
"device": "dev:860322068012345",
"sn": "My Device",
"product": "product:com.blues.project.demo",
"app": "app:2606f411-dea6-44a0-9743-1130f57d77d8",
"received": 1656011227.006928,
"req": "note.add",
"when": 1656011221,
"file": "data.qo",
"updates": 1,
"body": {
"humidity": 40.375,
"pressure": 97705.66,
"temperature": 24.0625
},
"wire_length": 42,
"best_location_type": "triangulated",
"best_location_when": 1656010061,
"best_lat": 33.7489954,
"best_lon": -84.3879824,
"best_location": "Atlanta GA",
"best_country": "US",
"best_timezone": "America/New_York",
"tower_when": 1656010061,
"tower_lat": 33.7542188,
"tower_lon": -84.3901562,
"tower_location": "Atlanta GA",
"tower_country": "US",
"tower_timezone": "America/New_York",
"tower_id": "310,410,17169,77315594",
"tri_when": 1656010061,
"tri_lat": 33.7489954,
"tri_lon": -84.3879824,
"tri_location": "Atlanta GA",
"tri_country": "US",
"tri_timezone": "America/New_York",
"tri_points": 6
},
{
"event": "3f7a5c21-9d4e-4b8a-a1f2-6c0e8d9b7a54",
"session": "b623132c-6afb-4740-bc39-e3634e38f064",
"best_id": "My Device",
"device": "dev:860322068012345",
"sn": "My Device",
"product": "product:com.blues.project.demo",
"app": "app:2606f411-dea6-44a0-9743-1130f57d77d8",
"received": 1656010061.413702,
"req": "session.begin",
"when": 1656010061,
"file": "_session.qo",
"platform": true,
"updates": 1,
"body": {
"opened": true,
"why": "first sync; continuous connection mode (TLS)"
},
"best_location_type": "triangulated",
"best_location_when": 1656010061,
"best_lat": 33.7489954,
"best_lon": -84.3879824,
"best_location": "Atlanta GA",
"best_country": "US",
"best_timezone": "America/New_York",
"tower_when": 1656010061,
"tower_lat": 33.7542188,
"tower_lon": -84.3901562,
"tower_location": "Atlanta GA",
"tower_country": "US",
"tower_timezone": "America/New_York",
"tower_id": "310,410,17169,77315594",
"tri_when": 1656010061,
"tri_lat": 33.7489954,
"tri_lon": -84.3879824,
"tri_location": "Atlanta GA",
"tri_country": "US",
"tri_timezone": "America/New_York",
"tri_points": 6,
"rssi": -63,
"sinr": 12,
"rsrp": -94,
"rsrq": -11,
"rat": "lte",
"bars": 3,
"voltage": 4.17,
"temp": 25.625,
"sku": "NOTE-NBGL",
"ordering_code": "XBOXT1N5AFAB"
}
],
"has_more": false,
"next_cursor": "1784278029057227.52735"
}Get Project Events by Cursor Notehub Deprecated
Get an array of Notehub events by ProjectUID and cursor (i.e. a means of limiting your result set).
This request is deprecated. Use the
Get Project Events
request with the cursor argument instead.
| HTTP Method: | GET |
| URL: | https://api.notefile.net/v1/projects/{projectOrProductUID}/events-cursor |
| Path Parameters: |
|
| Minimum Notehub project-level role: | viewer |
| Required HTTP Headers: | Authorization: Bearer <token>, where the token is a valid authentication 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, maximum value is
10000). 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/<projectOrProductUID>/events-cursor'
-H 'Authorization: Bearer <access_token>'import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8";
let opts = {
limit: 50,
};
apiInstance.getEventsByCursor(projectOrProductUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data),
);
},
(error) => {
console.error(error);
},
);import os
from pprint import pprint
import notehub_py
configuration = notehub_py.Configuration(
access_token=os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
api_instance = notehub_py.EventApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8"
try:
api_response = api_instance.get_events_by_cursor(
project_or_product_uid, limit=50
)
print("The response of EventApi->get_events_by_cursor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_events_by_cursor: %s\n" % e)curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/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_when": 1652709545,
"tower_lat": 34.82475372,
"tower_lon": -83.32261614,
"tower_location": "Atlanta GA",
"tower_country": "US",
"tower_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/{projectOrProductUID}/fleets/{fleetUID}/events |
| Path Parameters: |
|
| Minimum Notehub project-level role: | viewer |
| Required HTTP Headers: | Authorization: Bearer <token>, where the token is a valid authentication 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.
cursor
string (optional)
Use this to retrieve events in batches, ordered by when each event was last
created or updated in Notehub (oldest first). Each response includes has_more,
which is true if there are more events to retrieve, and a next_cursor value
to pass as the cursor of your next request to get the next batch. Set cursor
to:
0to start from the beginning.- A Unix epoch time in microseconds (UTC) to retrieve only events last changed at or after that time.
- The
next_cursorvalue returned by a previous request, to pick up where that request left off.
When format is csv, the response body is plain CSV rows with no room for
has_more or next_cursor, so read them from the X-Has-More and
X-Next-Cursor response headers instead.
cursor cannot be combined with pageNum, sortBy, or sortOrder.
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)
Start date for filtering results, specified as a Unix timestamp
endDate
UNIX Epoch time (optional)
End date for filtering results, specified as a Unix timestamp.
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/<projectOrProductUID>/fleets/<fleetUID>/events'
-H 'Authorization: Bearer <access_token>'import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8";
let fleetUID = "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d";
let opts = {
pageSize: 50,
pageNum: 1,
};
apiInstance.getFleetEvents(projectOrProductUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data),
);
},
(error) => {
console.error(error);
},
);import os
from pprint import pprint
import notehub_py
configuration = notehub_py.Configuration(
access_token=os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
api_instance = notehub_py.EventApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8"
fleet_uid = "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"
try:
api_response = api_instance.get_fleet_events(
project_or_product_uid, fleet_uid, page_size=50, page_num=1
)
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/<projectOrProductUID>/fleets/<fleetUID>/events?pageSize=<pageSize>&pageNum=<pageNum>&cursor=<cursor>&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.
next_cursor
string (optional)
A marker for where this batch of events ended. Pass it, exactly as returned, as
the cursor argument of your next request to get the next batch. It's returned
even when has_more is false, so once you've caught up you can keep using it
to retrieve only the events that have changed since. When format is csv,
read this value from the X-Next-Cursor response header instead. Only returned
when the request includes a cursor.
{
"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,
"next_cursor": "1784278029057227.52735"
}Get Fleet Events by Cursor Notehub Deprecated
Get an array of Notehub events by FleetUID and cursor (i.e. a means of limiting your result set).
This request is deprecated. Use the
Get Fleet Events
request with the cursor argument instead.
| HTTP Method: | GET |
| URL: | https://api.notefile.net/v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor |
| Path Parameters: |
|
| Minimum Notehub project-level role: | viewer |
| Required HTTP Headers: | Authorization: Bearer <token>, where the token is a valid authentication 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, maximum value is
10000). 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)
Start date for filtering results, specified as a Unix timestamp
endDate
UNIX Epoch time (optional)
End date for filtering results, specified as a Unix timestamp.
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/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 Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8";
let fleetUID = "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d";
let opts = {
limit: 50,
};
apiInstance.getFleetEventsByCursor(projectOrProductUID, fleetUID, opts).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data),
);
},
(error) => {
console.error(error);
},
);import os
from pprint import pprint
import notehub_py
configuration = notehub_py.Configuration(
access_token=os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
api_instance = notehub_py.EventApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8"
fleet_uid = "fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"
try:
api_response = api_instance.get_fleet_events_by_cursor(
project_or_product_uid, fleet_uid, limit=50
)
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/{projectOrProductUID}/events/{eventUID}/route-logs |
| Path Parameters: |
|
| Minimum Notehub project-level role: | viewer |
| Required HTTP Headers: | Authorization: Bearer <token>, where the token is a valid authentication token. |
curl -X GET
-L 'https://api.notefile.net/v1/projects/<projectOrProductUID>/events/<eventUID>/route-logs'
-H 'Authorization: Bearer <access_token>'import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";
let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8";
let eventUID = "dfa3747d-688b-4250-935b-5dd60354313c";
apiInstance.getRouteLogsByEvent(projectOrProductUID, eventUID).then(
(data) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data),
);
},
(error) => {
console.error(error);
},
);import os
from pprint import pprint
import notehub_py
configuration = notehub_py.Configuration(
access_token=os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
api_instance = notehub_py.EventApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8"
event_uid = "dfa3747d-688b-4250-935b-5dd60354313c"
try:
api_response = api_instance.get_route_logs_by_event(
project_or_product_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
If true, an error was returned when routing.
status
string
The status of the event.
text
string
The response body of the route.
url
string
The URL 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",
"url": "https://example.com/route"
}
]