🚀 Browse our open source reference applications to accelerate your IoT project!

Search
Documentation Results
End of results
Community Results
End of results
Support
Blues.io
Notehub.io
Shop
Sign In
Search
Documentation Results
End of results
Community Results
End of results
Support
Blues.io
Notehub.io
Shop
×
HomeReference
Glossary
Hardware
System Notefiles
Notecard API
Introduction
card Requests
dfu Requests
env Requests
file Requestsfile.changesfile.changes.pendingfile.deletefile.stats
hub Requests
note Requests
web Requests
Notehub API
API Introduction
Billing Account API
Device API
Environment Variable API
Event API
File API
Fleet API
Note API
Product API
Project API
Route API
Rate this page  
  • ★
    ★
  • ★
    ★
  • ★
    ★
  • ★
    ★
  • ★
    ★
Can we improve this page? Send us feedbackRate this page
  • ★
    ★
  • ★
    ★
  • ★
    ★
  • ★
    ★
  • ★
    ★
© 2023 Blues Inc.Terms & ConditionsPrivacy
blues.ioTwitterLinkedInGitHubHackster.io
Disconnected
Notecard Disconnected
Having trouble connecting?

Try changing your Micro 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

file Requests

The file set of requests enable developers to work with all types of Notefiles.

file.changes

Used to perform queries on a single or multiple files to determine if new Notes are available to read, or if there are unsynced Notes in local Notefiles. Note: This request is a Notefile API request, only. .qo Notes in Notehub are automatically ingested and stored, or sent to applicable Routes.

Arguments

files

array of strings (optional)

One or more files to obtain change information from. Omit to return changes for all Notefiles.

tracker

string (optional)

ID of a change tracker to use to determine changes to Notefiles.

access_token

string (Notehub curl requests only)

A Notehub API bearer token.

projectUID

string (Notehub curl requests only)

The ProjectUID of a Notehub project.

deviceUID

string (Notehub curl requests only)

The globally-unique DeviceUID of a device that currently exists within the specified ProjectUID.

You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.

      {
        "req": "file.changes",
        "tracker": "multi-file-tracker",
        "files": ["my-settings.db", "other-settings.db"]
      }
      J *req = NoteNewRequest("file.changes");
      JAddStringToObject(req, "tracker", "multi-file-tracker");
      
      J *files = JAddArrayToObject(req, "files");
      JAddItemToArray(files, JCreateString("other-settings.db"));
      JAddItemToArray(files, JCreateString("my-settings.db"));
      
      NoteRequest(req);
      req = {"req": "file.changes"}
      req["tracker"] = "multi-file-tracker"
      req["files"] = ["my-settings.db", "other-settings.db"]
      rsp = card.Transaction(req)
      curl -X GET
           -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/files/changes?tracker=<tracker>&files=[<files>]'
           -H 'Authorization: Bearer <access_token>'
      Response Members

      total

      integer

      The total of local Notes across all Notefiles. This includes Inbound Notes that have not been deleted, as well as outbound Notes that have yet to sync.

      changes

      integer

      If a change tracker is used, the number of changes across all files.

      info

      JSON object

      An object with a key for each Notefile that matched the request parameters, and value object with the changes and total for each file.

      Example Response
      {
        "changes": 5,
        "total": 5,
        "info": {
          "my-settings.db": { "changes": 3, "total": 3 },
          "other-settings.db": { "changes": 2, "total": 2 }
        }
      }
      More information:
      • Retrieving Inbound Notes

      • Using a Change Tracker Across Notefiles

      file.changes.pending

      Returns info about file changes that are pending upload to Notehub or download to the Notecard.

      Arguments

      access_token

      string (Notehub curl requests only)

      A Notehub API bearer token.

      projectUID

      string (Notehub curl requests only)

      The ProjectUID of a Notehub project.

      deviceUID

      string (Notehub curl requests only)

      The globally-unique DeviceUID of a device that currently exists within the specified ProjectUID.

      You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.

          {
            "req": "file.changes.pending"
          }
          J *req = NoteNewRequest("file.changes.pending");
          
          NoteRequest(req);
          req = {"req": "file.changes.pending"}
          rsp = card.Transaction(req)
          curl -X GET
               -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/files/changes/pending'
               -H 'Authorization: Bearer <access_token>'
          Response Members

          total

          integer

          The total of unsynched notes across all Notefiles.

          changes

          integer

          The number of changes across all files.

          pending

          boolean

          true if there are pending changes.

          info

          JSON object

          An object with a key for each Notefile and value object with the changes and total for each file.

          Example Response
          {
            "total":   3,
            "changes": 3,
            "pending": true,
            "info":   {
              "sensors.qo": {"changes":3,"total":3}
            }
          }

          file.delete

          Deletes Notefiles and the Notes they contain.

          Arguments

          files

          array of strings

          One or more files to delete.

          access_token

          string (Notehub curl requests only)

          A Notehub API bearer token.

          projectUID

          string (Notehub curl requests only)

          The ProjectUID of a Notehub project.

          deviceUID

          string (Notehub curl requests only)

          The globally-unique DeviceUID of a device that currently exists within the specified ProjectUID.

          You may alternatively provide a device serial number by prefixing this argument with sn:, for example sn:my-device.

              {
                "req": "file.delete",
                "files": ["my-settings.db","other-settings.db"]
              }
              J *req = NoteNewRequest("file.delete");
              
              J *files = JAddArrayToObject(req, "files");
              JAddItemToArray(files, JCreateString("other-settings.db"));
              JAddItemToArray(files, JCreateString("my-settings.db"));
              
              NoteRequest(req);
              req = {"req": "file.delete"}
              req["files"] = ["my-settings.db", "other-settings.db"]
              card.Transaction(req)
              curl -X DELETE
                   -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/files'
                   -H 'Authorization: Bearer <access_token>'
                   -d '{"files": [<files>]}'
              Response Members
              None: an empty object {} means success.

              file.stats

              Gets resource statistics about local Notefiles.

              Arguments

              file (Added in v1.5.6)

              string (optional)

              Returns the stats for the specified Notefile only.

                  {
                    "req": "file.stats"
                  }
                  J *req = NoteNewRequest("file.stats");
                  
                  NoteRequest(req);
                  req = {"req": "file.stats"}
                  rsp = card.Transaction(req)
                  Response Members

                  total

                  integer

                  The total number of Notes across all Notefiles.

                  changes

                  integer

                  The number of Notes across all Notefiles pending sync.

                  sync

                  boolean

                  true if a sync is recommended based on the number of pending notes.

                  Example Response
                  {
                    "total":   83,
                    "changes": 78,
                    "sync":    true
                  }
                  env Requestshub Requests