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:
Latest (9.x)

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 (optional)

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

Delete a variable named "status" from the default vars.db DB Notefile.

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

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

Delete a variable named "temperature" from the "sensors.db" DB Notefile.

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 (optional)

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)

Retrieve a variable named "status" from the default vars.db DB Notefile.

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

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

Retrieve a variable named "temperature" from the sensors.db DB Notefile.

Response Members

flag

boolean

The boolean value stored in the DB Notefile.

text

string

The string-based value stored in the DB Notefile.

value

number

The numeric value stored in the DB Notefile.

Example Response
{
  "text": "open"
}

Response containing a string value from the DB Notefile.

{
  "value": 42
}

Response containing a numeric value from the DB Notefile.

{
  "flag": true
}

Response containing a boolean value from the DB Notefile.

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 (optional)

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

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