Learn how to get started with Cellular, Wi-Fi, LoRa, and Satellite using Blues Notecard on September 25th

Blues Developers
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Button IconHelp
Notehub StatusVisit our Forum
Button IconSign In
Docs Home
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Guides & Tutorials
Collecting Sensor Data
Routing Data to Cloud
Building Edge AI Applications
Best Practices for Production-Ready Projects
Twilio SMS Guide
Fleet Admin Guide
Using the Notehub API
AuthenticatingRetrieving Devices and EventsAdding NotesManaging Fleets
Notecard Guides
Guide Listing
Asset Tracking with GPS
Attention Pin Guide
Connecting to a Wi-Fi Access Point
Debugging with the FTDI Debug Cable
Diagnosing Cellular Connectivity Issues
Diagnosing GPS Issues
Encrypting and Decrypting Data with the Notecard
Feather MCU Low Power Management
Minimizing Latency
Notecard Communication Without a Library
Recovering a Bricked Notecard
Remote Command and Control
Sending and Receiving Large Binary Objects
Serial-Over-I2C Protocol
Understanding Environment Variables
Understanding Notecard Penalty Boxes
Updating ESP32 Host Firmware
Using External SIM Cards
Using JSONata to Transform JSON
Using Notecard Trace Mode
homechevron_rightDocschevron_rightGuides & Tutorialschevron_rightUsing the Notehub API

Using the Notehub API

The Notehub API allows you to perform a variety of actions on your Notehub projects without having to use the Notehub UI.

In this tutorial you'll learn how the Notehub API works by performing a handful of requests, including retrieving project devices and events, sending a Note to one of your project's Notecards, and creating and updating a Notehub fleet. But before performing any Notehub API request you must first retrieve an authentication token.

note

Before starting this guide make sure you've created a Notehub account and created a Notehub project.

Authenticating

All Notehub API requests require an authentication token. The easiest way to get started is by creating a Personal Access Token, a user-level authentication token that can be created and managed through the Notehub user interface.

Complete the following steps to create a new personal access token.

  1. Navigate to Notehub and sign into your account.

  2. From the user menu in the top-right corner, select the API Access option. The Personal Access Token menu in Notehub

  3. On the next screen, click the Create New Token button.

  4. In the resulting dialog, give your token a Token Name, an optional Description and an Expiration, and then click Create. Dialog for creating new personal access tokens in Notehub

  5. In the next dialog, use the Copy button to copy the token to your clipboard and store it somewhere safe. Copying a personal access token in Notehub

    warning

    Personal access tokens have the same permissions as your Notehub user account. When storing personal acccess tokens, use the same caution as you would with a password or other sensitive material.

Now that you have an authentication token, let's look at how to send other Notehub API requests.

Retrieving Devices and Events

As a first set of requests, let's look at how to retrieve a list of devices and events from your Notehub project.

Retrieving Devices

To get a list of devices from your Notehub project you can use the Notehub API's /projects/<projectUID>/devices endpoint, where <projectUID> is your project's ProjectUID. For authorization, you'll need to include the personal access token you created in the previous step as part of a Authorization header.

If you're comfortable using the curl command, you can run the request using the syntax shown below, replacing <projectUID> with your project's ProjectUID and <your_token> with your personal access token.

curl -X GET
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices'
     -H 'Authorization: Bearer <your_token>'

An example of using curl to retrieve devices

If you're not comfortable with curl there are a variety of other tools you can use to send HTTP requests. For example, the screenshot below shows how to use Postman to send a GET request to the /projects/<projectUID>/devices endpoint.

An example of using Postman to retrieve devices

note

There are a variety of options you can use to retrieve devices from Notehub projects. Refer to the Device API for more information on the different requests and arguments you can use.

Retrieving Events

Next let's look at how to retrieve events from your Notehub project. The easiest way to get a list of events is by sending a GET request to the API's /projects/<projectUID>/events endpoint. Here's what that looks like with curl using a personal access token:

curl -X GET
     -L 'https://api.notefile.net/v1/projects/<projectUID>/events'
     -H 'Authorization: Bearer <your_token>'

An example of using curl to retrieve events

And here's what that looks like in Postman.

An example of using Postman to retrieve events

note

As with devices, there are a variety of ways you can retrieve events from Notehub projects. Refer to the Event API for more information on the different requests and arguments you can use.

Adding Notes

Next, let's look at how you can use the Notehub API to send a Note to a device. To complete this step, you must have a device associated with your Notehub project (e.g. it has already synced with the project).

Once you have a device on your project, you can send a POST to the API's /projects/<projectUID>/devices/<deviceUID>/notes/<file> endpoint, where projectUID is your ProjectUID, deviceUID is the DeviceUID of a device in your Notehub project, and <file> is the name of the Notefile you'd like to use (e.g. data.qi).

Here's an example of how to send that request with curl using a personal access token:

curl -X POST
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/notes/<file>'
     -H 'Authorization: Bearer <your_token>'
     -d '{"body": {"temp": 72.22 }}'

An example of how to send a note using curl

And here's that same example in Postman.

An example of how to send a note using Postman

Once you've sent your Note you can view it immediately on your Notehub project's event list.

A look at the new event in Notehub

note

You can retrieve inbound Notes on a Notecard by using the Notecard API's note.get request.

Managing Fleets

Finally, let's look at a few Notehub APIs to manage fleets, which are groupings of one or more devices.

To use fleets you must first create one, which you can do by sending a POST to the Notehub API's /projects/<projectUID>/fleets endpoint, and including {"label":"Name of your fleet"} in the request body.

curl -X POST
     -L 'https://api.notefile.net/v1/projects/<projectUID>/fleets'
     -H 'Authorization: Bearer <your_token>'
     -d '{"label":"My new fleet"}'

Here's what that looks like in action.

An example of how to use curl to create a fleet

An example of how to use Postman to create a fleet

Make note of your FleetUID (the uid in the /projects/<projectUID>/fleets response), as you'll need it for the next request.

Once you have a fleet, you can use the Notehub API to add and remove devices from a fleet using the API's /projects/<projectUID>/devices/<deviceUID>/fleets endpoint. You can send a PUT request when you'd like to add devices to a fleet, and a DELETE request when you'd like to remove devices from a fleet.

For this tutorial let's look at how to add a device to a fleet, which you can do by sending a PUT to /projects/<projectUID>/devices/<deviceUID>/fleets, and by including {"fleet_uids":[<fleet_uids>]} (where {fleet_uids} is an array of all FleetUIDs to add) in the request body.

curl -X PUT
     -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/fleets'
     -H 'Authorization: Bearer <your_token>'
     -d '{"fleet_uids":[<fleet_uids>]}'

Here's what that looks like in action.

An example of how to use curl to add a device to a fleet

An example of how to use Postman to add a device to a fleet

note

There are a number of additional APIs available to help you manage Notehub device fleets. For more information, check out the Project API.

Additional Resources

Overall, the Notehub API provides a variety of ways to perform Notehub actions without using the Notehub UI. Check out the following resources to learn more.

  • Notehub API Reference: A full listing of all Notehub API requests and examples on how to use them.
  • Blues community forum : A great place to reach out for help if you get stuck using the Notehub API.
Can we improve this page? Send us feedback
© 2025 Blues Inc.
© 2025 Blues Inc.
TermsPrivacy
Notecard Disconnected
Having trouble connecting?

Try changing your USB cable as some cables do not support transferring data. If that does not solve your problem, contact us at support@blues.com and we will get you set up with another tool to communicate with the Notecard.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with the Notecard's API on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up