Scaling an IoT deployment? Join our webinar on May 28th where we dive into real-world scaling pain points and how to overcome them.

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
Sign In
Sign 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
API Reference
Glossary
System Notefiles
Notecard API
Introduction
card Requests
dfu Requests
env Requests
file Requests
hub Requests
note Requests
ntn Requests
var Requests
var.deletevar.getvar.set
web Requests
Notehub API
API Introduction
Authorization API
Billing Account API
Device API
Event API
Monitor API
Project API
Route API
homechevron_rightDocschevron_rightAPI Referencechevron_rightNotecard APIchevron_rightvar Requests - API Reference

var Requests

The var APIs provide a simple abstraction over the existing note.update, note.get, and note.delete APIs for managing data stored in DB Notefiles.

Notecard Firmware Version:
8.x LTS
Latest (9.x)8.x LTS7.x6.x LTS5.x4.x LTS3.x2.x LTS

var.delete CellCell+WiFiLoRaWiFi

Delete a Note from a DB Notefile by its name. Provides a simpler interface to the note.delete API.

Arguments

file

string

The name of the DB Notefile that contains the Note to delete. Default value is vars.db.

name

string

The unique Note ID.

{
  "req": "var.delete",
  "name": "status"
}
J *req = NoteNewRequest("var.delete");
JAddStringToObject(req, "name", "status");

NoteRequest(req);
req = {"req": "var.delete"}
req["name"] = "status"
card.Transaction(req)
Response Members
None: an empty object {} means success.

var.get CellCell+WiFiLoRaWiFi

Retrieves a Note from a DB Notefile. Provides a simpler interface to the note.get API.

Arguments

file

string

The name of the DB Notefile that contains the Note to retrieve. Default value is vars.db.

name

string

The unique Note ID.

{
  "req": "var.get",
  "name": "status"
}
J *req = NoteNewRequest("var.get");
JAddStringToObject(req, "name", "status");

NoteRequest(req);
req = {"req": "var.get"}
req["name"] = "status"
rsp = card.Transaction(req)
Response Members

text

string

The string-based value stored in the DB Notefile.

value

integer

The numeric value stored in the DB Notefile.

flag

boolean

The boolean value stored in the DB Notefile.

Example Response
{
  "text": "open"
}

var.set CellCell+WiFiLoRaWiFi

Adds or updates a Note in a DB Notefile, replacing the existing body with the specified key-value pair where text, value, or flag is the key. Provides a simpler interface to the note.update API.

Arguments

file

string

The name of the DB Notefile that contains the Note to add or update. Default value is vars.db.

name

string

The unique Note ID.

text

string (optional)

The string-based value to be stored in the DB Notefile.

value

integer (optional)

The numeric value to be stored in the DB Notefile.

flag

boolean (optional)

The boolean value to be stored in the DB Notefile.

sync

boolean (optional)

Set to true to immediately sync any changes.

{
  "req": "var.set",
  "name": "status",
  "text": "open"
}
J *req = NoteNewRequest("var.set");
JAddStringToObject(req, "name", "status");
JAddStringToObject(req, "text", "open");

NoteRequest(req);
req = {"req": "var.set"}
req["name"] = "status"
req["text"] = "open"
card.Transaction(req)
Response Members
None: an empty object {} means success.
ntn Requests web Requests
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 Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up