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
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:
2.x LTS

var.delete CellCell+WiFiLoRaWiFi

note

This request is not available in the currently selected Notecard firmware version.

var.get CellCell+WiFiLoRaWiFi

note

This request is not available in the currently selected Notecard firmware version.

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

flag

boolean (optional)

The boolean value to be stored in the DB Notefile.

name

string

The unique Note ID.

sync

boolean (optional)

Set to true to immediately sync any changes.

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.

{
  "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"
rsp = card.Transaction(req)

Set a text variable named "status" to "open" in the default vars.db DB Notefile.

{
  "req": "var.set",
  "name": "temperature",
  "value": 23,
  "file": "sensors.db"
}
J *req = NoteNewRequest("var.set");
JAddStringToObject(req, "name", "temperature");
JAddNumberToObject(req, "value", 23);
JAddStringToObject(req, "file", "sensors.db");

NoteRequest(req);
req = {"req": "var.set"}
req["name"] = "temperature"
req["value"] = 23
req["file"] = "sensors.db"
rsp = card.Transaction(req)

Set a numeric variable named "temperature" to 23 in a specific DB Notefile.

{
  "req": "var.set",
  "name": "active",
  "flag": true,
  "sync": true
}
J *req = NoteNewRequest("var.set");
JAddStringToObject(req, "name", "active");
JAddBoolToObject(req, "flag", true);
JAddBoolToObject(req, "sync", true);

NoteRequest(req);
req = {"req": "var.set"}
req["name"] = "active"
req["flag"] = True
req["sync"] = True
rsp = card.Transaction(req)

Set a boolean variable named "active" to true and immediately sync changes.

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 the Notecard's API on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up