🚀 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 Requests
hub Requests
note Requests
web Requests
Notehub API
API Introduction
Billing Account API
Device API
Environment Variable API
Event API
File API
Fleet APIGet FleetsCreate FleetUpdate FleetDelete FleetGet Fleets by DeviceGet Devices by FleetAdd Device to FleetsRemove Device from Fleets
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

Fleet API

The Notehub fleet API provides RESTful methods that can be used to GET, POST, PUT, and DELETE data related to fleets.

Get Fleets

Get an array of fleets associated with a ProjectUID.

Minimum Notehub project-level role required:

Arguments

access_token

string

A Notehub API bearer token.

projectUID

string

The ProjectUID from a Notehub project.

    curl -X GET
         -L 'https://api.notefile.net/v1/projects/<projectUID>/fleets'
         -H 'Authorization: Bearer <access_token>'
    Response Members

    uid

    string

    The globally-unique identifier of the fleet.

    label

    string

    The user-defined label of the fleet.

    created

    string

    The date and time the fleet was created.

    Example Response
    {
      "fleets": [
        {
          "uid": "fleet:00000000-0000-0000-0000-000000000000",
          "label": "Production",
          "created": "2021-04-10T21:18:38Z"
        },
        {
          "uid": "fleet:00000000-0000-0000-0000-000000000000",
          "label": "Staging",
          "created": "2021-02-11T01:03:46Z"
        },
        {
          "uid": "fleet:00000000-0000-0000-0000-000000000000",
          "label": "Testing",
          "created": "2021-02-11T01:03:32Z"
        }
      ]
    }

    Create Fleet

    Create a new device fleet within a Notehub project.

    Minimum Notehub project-level role required:

    Arguments

    access_token

    string

    A Notehub API bearer token.

    projectUID

    string

    The ProjectUID of a Notehub project.

    label

    string

    The requested label for the fleet.

      curl -X POST
           -L 'https://api.notefile.net/v1/projects/<projectUID>/fleets'
           -H 'Authorization: Bearer <access_token>'
           -d '{"label":"<label>"}'
      Response Members

      uid

      string

      The globally-unique identifier for the fleet.

      label

      string

      The user-defined label of the fleet.

      created

      time stamp

      The date/time the fleet was created.

      Example Response
      {
        "uid":"fleet:00000000-0000-0000-0000-000000000000",
        "label":"My Fleet Label",
        "created":"2021-10-12T16:21:54Z"
      }

      Update Fleet

      Update the label of a device fleet.

      Minimum Notehub project-level role required:

      Arguments

      access_token

      string

      A Notehub API bearer token.

      projectUID

      string

      The ProjectUID of a Notehub project.

      fleetUID

      string

      The FleetUID of a Notehub device fleet.

      label

      string

      The updated label for the fleet.

      addDevices

      array (optional)

      A list of DeviceUIDs to add to the fleet.

      removeDevices

      array (optional)

      A list of DeviceUIDs to remove from the fleet.

        curl -X PUT
             -L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>'
             -H 'Authorization: Bearer <access_token>'
             -d '{"label":"<label>"}'
        Response Members

        uid

        string

        The globally-unique identifier for the fleet.

        label

        string

        The user-defined label of the fleet.

        created

        time stamp

        The date/time the fleet was created.

        Example Response
        {
          "uid":"fleet:00000000-0000-0000-0000-000000000000",
          "label":"My Fleet Label",
          "created":"2021-10-12T16:21:54Z"
        }

        Delete Fleet

        Delete a device fleet.

        Minimum Notehub project-level role required:

        Arguments

        access_token

        string

        A Notehub API bearer token.

        projectUID

        string

        The ProjectUID of a Notehub project.

        fleetUID

        string

        The FleetUID of a Notehub device fleet.

          curl -X DELETE
               -L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>'
               -H 'Authorization: Bearer <access_token>'

          Get Fleets by Device

          Get an array of fleets associated with a device.

          Minimum Notehub project-level role required:

          Arguments

          access_token

          string

          A Notehub API bearer token.

          projectUID

          string

          The ProjectUID from a Notehub project.

          deviceUID

          string

          The globally-unique identifier of a device.

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

            curl -X GET
                 -L 'https://api.notefile.net/v1/projects/<projectUID>/devices/<deviceUID>/fleets'
                 -H 'Authorization: Bearer <access_token>'
            Response Members

            uid

            string

            The globally-unique identifier of the fleet.

            label

            string

            The user-defined label of the fleet.

            created

            string

            The date and time the fleet was created.

            Example Response
            {
              "fleets": [
                {
                  "uid": "fleet:00000000-0000-0000-0000-000000000000",
                  "label": "Production",
                  "created": "2021-04-10T21:18:38Z"
                },
                {
                  "uid": "fleet:00000000-0000-0000-0000-000000000000",
                  "label": "Staging",
                  "created": "2021-02-11T01:03:46Z"
                },
                {
                  "uid": "fleet:00000000-0000-0000-0000-000000000000",
                  "label": "Testing",
                  "created": "2021-02-11T01:03:32Z"
                }
              ]
            }

            Get Devices by Fleet

            Get an array of devices associated with a fleet.

            Minimum Notehub project-level role required:

            Arguments

            access_token

            string

            A Notehub API bearer token.

            projectUID

            string

            The ProjectUID from a Notehub project.

            fleetUID

            string

            The globally-unique identifier of a fleet.

              curl -X GET
                   -L 'https://api.notefile.net/v1/projects/<projectUID>/fleets/<fleetUID>/devices'
                   -H 'Authorization: Bearer <access_token>'
              Response Members

              uid

              string

              The globally-unique identifier of the device.

              serial_number

              string

              The user-defined serial number of the device.

              provisioned

              string

              The date and time this device was first provisioned, or put into use.

              last_activity

              string

              The date and time this device was last seen by Notehub.

              contact

              object

              Contact information for this device, specified via environment variables.

              product_uid

              string

              The ProductUID this device is associated with.

              fleet_uids

              array

              An array of globally-unique identifiers for the fleet(s) this device is associated with.

              tower_info

              object

              An object containing data about the cellular tower last accessed by this device.

              tower_info.mcc

              int

              The mobile country code of the cell tower.

              tower_info.mnc

              int

              The mobile network code of the cell tower, which identifies the mobile operator.

              tower_info.lac

              int

              The location area code of the cell tower, which is a unique identifier of the current location area.

              tower_info.cell_id

              int

              The Cell ID or CID of the cell tower. This is a unique number used to identify each Base Transceiver Station (BTS) or sector of a BTS within a location area code.

              tower_location

              object

              An object containing information about the physical location of the cell tower.

              gps_location

              object

              An object containing information about the physical location of the device, based on GPS coordinates.

              triangulated_location

              object

              An object containing information about the physical location of the device based on triangulated data calculated by multiple cell towers.

              voltage

              decimal

              The most recent measure of the voltage from the onboard voltage monitor.

              temperature

              decimal

              The most recent temperature measure in celsius from the onboard temperature sensor.

              has_more

              boolean

              Defines whether or not there are additional devices beyond this list.

              Example Response
              {
                 "devices":[
                    {
                       "uid":"dev:000000000000000",
                       "serial_number":"",
                       "provisioned":"2021-02-11T02:37:16Z",
                       "last_activity":"2021-05-11T19:37:08Z",
                       "contact":null,
                       "product_uid":"product:com.your-company.your-name:project",
                       "fleet_uids":"[fleet:00000000-0000-0000-0000-000000000000]",
                       "tower_info":{
                          "mcc":310,
                          "mnc":410,
                          "lac":12345,
                          "cell_id":12345678
                       },
                       "tower_location":{
                          "when":"2021-05-11T19:34:23Z",
                          "name":"Cassville MO",
                          "country":"US",
                          "timezone":"America/Chicago",
                          "latitude":36.665537500000006,
                          "longitude":-93.850109375
                       },
                       "gps_location":{
                          "same properties as tower_location"
                       },
                       "triangulated_location":{
                          "same properties as tower_location"
                       },
                       "voltage":5.15,
                       "temperature":23.75
                    }
                 ],
                 "has_more":false
              }

              Add Device to Fleets

              Add a device to one or more fleets.

              Minimum Notehub project-level role required:

              Arguments

              access_token

              string

              A Notehub API bearer token.

              projectUID

              string

              The ProjectUID from a Notehub project.

              deviceUID

              string

              The globally-unique identifier of a device.

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

              fleet_uids

              string

              A comma-separated list of globally-unique FleetUIDs.

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

                uid

                string

                The globally-unique identifier of the fleet.

                label

                string

                The user-defined label of the fleet.

                created

                string

                The date and time the fleet was created.

                Example Response
                {
                  "fleets": [
                    {
                      "uid": "fleet:00000000-0000-0000-0000-000000000000",
                      "label": "Production",
                      "created": "2021-04-10T21:18:38Z"
                    },
                    {
                      "uid": "fleet:00000000-0000-0000-0000-000000000000",
                      "label": "Staging",
                      "created": "2021-02-11T01:03:46Z"
                    },
                    {
                      "uid": "fleet:00000000-0000-0000-0000-000000000000",
                      "label": "Testing",
                      "created": "2021-02-11T01:03:32Z"
                    }
                  ]
                }

                Remove Device from Fleets

                Removes a device from one or more fleets.

                Minimum Notehub project-level role required:

                Arguments

                access_token

                string

                A Notehub API bearer token.

                projectUID

                string

                The ProjectUID from a Notehub project.

                deviceUID

                string

                The globally-unique identifier of a device.

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

                fleet_uids

                string array

                An array of globally-unique FleetUIDs.

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

                  uid

                  string

                  The globally-unique identifier of the fleet.

                  label

                  string

                  The user-defined label of the fleet.

                  created

                  string

                  The date and time the fleet was created.

                  Example Response
                  {
                    "fleets": [
                      {
                        "uid": "fleet:00000000-0000-0000-0000-000000000000",
                        "label": "Production",
                        "created": "2021-04-10T21:18:38Z"
                      },
                      {
                        "uid": "fleet:00000000-0000-0000-0000-000000000000",
                        "label": "Staging",
                        "created": "2021-02-11T01:03:46Z"
                      },
                      {
                        "uid": "fleet:00000000-0000-0000-0000-000000000000",
                        "label": "Testing",
                        "created": "2021-02-11T01:03:32Z"
                      }
                    ]
                  }
                  File APINote API