😌 Learn How to Simplify Host Firmware Updates with the Notecard on February 2nd !

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 API
Note API
Product API
Project API
Route APIGet RoutesGet Route by UIDCreate RouteUpdate Route by UIDDelete Route by UID
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

Route API

The Notehub route API provides RESTful methods that can be used to GET, PUT, POST, and DELETE Notehub routes.

Get Routes

Get an array of routes associated with a Notehub project.

Minimum Notehub project-level role required:

Arguments

authToken

string

A Notehub API authentication token.

projectUID

string

The ProjectUID from a Notehub project.

    curl -X GET
         -L 'https://api.notefile.net/v1/projects/<projectUID>/routes'
         -H 'X-SESSION-TOKEN: <authToken>'
    Response Members

    uid

    string

    The globally-unique identifier of the route.

    label

    string

    The name of the route.

    type

    string

    The service to which this route connects (see Create Route for a full list of route types).

    modified

    string

    The date and time this route was last modified.

    disabled

    boolean

    Whether or not this route is disabled.

    Example Response
    [
       {
          "uid":"route:0ac565deb7b478a250bb82347b9cfdd2",
          "label":"My HTTP Route",
          "type":"http",
          "modified":"2020-03-09T17:58:36Z",
          "disabled":false
       },
       {
          "uid":"route:fb1b9e0aba1bf030311ba2c3c1e7efd1",
          "label":"My Proxy Route",
          "type":"proxy",
          "modified":"2020-03-09T17:58:35Z",
          "disabled":false
       }
    ]

    Get Route by UID

    Get a single route by its RouteUID.

    Minimum Notehub project-level role required:

    Arguments

    authToken

    string

    A Notehub API authentication token.

    projectUID

    string

    The ProjectUID from a Notehub project.

    routeUID

    string

    The RouteUID of a route.

      curl -X GET
           -L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>'
           -H 'X-SESSION-TOKEN: <authToken>'
      Response Members

      uid

      string

      The globally-unique identifier of the route.

      label

      string

      The name of the route.

      type

      string

      The service to which this route connects (see above for a full list of route types).

      modified

      string

      The date and time this route was last modified.

      disabled

      boolean

      Whether or not this route is disabled.

      schema

      object

      Additional meta data specific to the type of route (see request members from Create Route for a complete list).

      Example Response
      {
         "uid":"route:0ac565deb7b478a250bb82347b9cfdd2",
         "label":"My HTTP Route",
         "type":"http",
         "modified":"2020-03-09T17:58:36Z",
         "disabled":false,
         "http": {
            "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
            "filter": {
               "type": "",
               "system_notefiles": false,
            },
            "transform": {},
            "throttle_ms": 100,
            "url": "http://route.url",
            "http_headers": null,
            "disable_http_headers": false,
            "timeout": 0
         }
      }

      Create Route

      Create a new route within a Notehub project.

      Minimum Notehub project-level role required:

      Arguments

      authToken

      string

      A Notehub API authentication token.

      projectUID

      string

      The ProjectUID from a Notehub project.

      label

      string

      The name of the route.

      type

      string

      The specific service to which this route connects.

      Must be one of: "http", "proxy", "google-function", "mqtt", "aws-lambda", "aws-lambda-with-access-key", "aws-sqs", "aws-sqs-with-access-key", "aws-sqs-fifo", "aws-sqs-fifo-with-access-key", "aws-iot-analytics", "radnote-radresp-fixed-survey", "radnote-radresp-mobile-survey", "azure-function", "azure-function-with-key", "azure-service-bus-with-sas-token", "thingworx", "snowflake", "twilio".

      disabled

      boolean

      Whether or not this route is disabled.

      schema

      string

      Name of the high level route schema, used to supply settings specific to the chosen type.

      Must be one of: "http", "google", "proxy", "mqtt", "aws", "radresponder", "azure", "thingworx", "snowflake", "twilio".

      fleets

      string

      An array of fleetUIDs to which to apply the route. If empty, applies to all fleets.

      filter

      object

      Applies to all route schemas except "proxy" and "radresponder".

      Route filtering settings; see below:

      filter.type

      string

      Which Notefiles this route applies to. Must be one of: "all", "include", "exclude".

      filter
      .system
      _notefiles

      boolean

      Whether or not system Notefiles should be routed.

      filter.files

      string

      An array of Notefile names to include in the filter. For example, if include is the type, these are the only Notefiles that will be included.

      transform

      object

      Applies to all route schemas except "proxy" and "radresponder".

      Data transformation settings; see below:

      transform
      .format

      string

      The data transformation to apply.

      Must be one of: "bridge" (Azure only), "jsonata", "flatten", "simple", "body", "payload".

      transform
      .jsonata

      string

      If jsonata format, the JSONata expression to be used.

      throttle_ms

      integer

      Applies to all route schemas except "proxy", "radresponder", and "snowflake".

      Minimum time between requests, in milliseconds.

      url

      string

      Applies to all route schemas except "mqtt", "radresponder", "snowflake", and "twilio".

      The external service endpoint URL.

      http_headers

      object

      Only applies to "http", "proxy", and "aws" route schemas.

      Key:value pairs of HTTP headers. Both the key and value are strings.

      disable
      _http
      _headers

      boolean

      Only applies to "http" and "aws" route schemas.

      Whether or not the HTTP header values should be disabled.

      timeout

      integer

      Applies to all route schemas except "radresponder".

      Timeout in seconds for each request.

      region

      string

      Only applies to "aws" route schema using "aws-lambda-with-access-key", "aws-sqs-with-access-key", "aws-sqs-fifo-with-access-key", or "aws-iot-analytics" route types.

      The AWS geographic region (e.g. us-east-1).

      access_key_id

      string

      Only applies to "aws" route schema using "aws-lambda-with-access-key", "aws-sqs-with-access-key", "aws-sqs-fifo-with-access-key", or "aws-iot-analytics" route types.

      The public access key used to make calls to AWS.

      access
      _key
      _secret

      string

      Only applies to "aws" route schema using "aws-lambda-with-access-key", "aws-sqs-with-access-key", "aws-sqs-fifo-with-access-key", or "aws-iot-analytics" route types.

      The secret access key used to make calls to AWS.

      message
      _group
      _id

      string

      Only applies to "aws" route schema using "aws-sqs-fifo" or "aws-sqs-fifo-with-access-key" route types.

      The tag that specifies that a message belongs to a specific message group.

      message
      _deduplication
      _id

      string

      Only applies to "aws" route schema using "aws-sqs-fifo" or "aws-sqs-fifo-with-access-key" route types.

      The token used for deduplication of sent messages.

      channel

      string

      Only applies to "aws" route schema using "aws-iot-analytics" route type.

      The AWS IoT Analytics channel.

      sas_policy_name

      string

      Only applies to "azure" route schema using "azure-service-bus-with-sas-token" route type.

      The Azure SAS policy name used to authenticate to a resource.

      sas_policy_key

      string

      Only applies to "azure" route schema using "azure-service-bus-with-sas-token" route type.

      The Azure SAS policy key used to authenticate to a resource.

      app_key

      string

      Only applies to "thingworx" route schema.

      The ThingWorx security token.

      broker

      string

      Only applies to "mqtt" route schema.

      The MQTT broker URL. The URL should be of the form scheme://host where scheme is one of "mqtt", "mqtts", "tcp", "ssl", "ws", or "wss".

      port

      integer

      Only applies to "mqtt" route schema.

      The port of the MQTT broker instance.

      username

      string

      Only applies to "mqtt" route schema.

      The MQTT username for authentication.

      password

      string

      Only applies to "mqtt" route schema.

      The MQTT password for authentication.

      topic

      string

      Only applies to "mqtt" route schema.

      The string that the MQTT broker uses to filter messages for each connected client.

      Certain substitution variables are available for the MQTT topic field when events are routed.

      For example, for an event from a device with a UID of "dev:1234" and ProductUID of "com.example.test", the MQTT topic "[product]/devices/[device]" would send the event body to the topic "com.example.test/devices/1234".

      By default, the topic is set to "device/[device]".

      certificate

      string

      Only applies to "mqtt" route schema.

      The SSL certificate with \n for new lines.

      certificate
      _name

      string

      Only applies to "mqtt" route schema.

      The name of the SSL certificate.

      key

      string

      Only applies to "mqtt" route schema.

      The SSL certificate key with `\n\ for new lines.

      private
      _key
      _name

      string

      Only applies to "mqtt" route schema.

      The name of the SSL certificate key.

      test_api

      boolean

      Only applies to "radresponder" route schema.

      Whether or not to enable RadResponder test site.

      data_feed_key

      string

      Only applies to "radresponder" route schema.

      The key for the RadResponder data feed.

      client_id

      string

      Only applies to "radresponder" route schema.

      The RadResponder client ID.

      client
      _secret

      string

      Only applies to "radresponder" route schema.

      The RadResponder client secret.

      org_name

      string

      Only applies to "snowflake" route schema.

      The unique organization name set at the time when the Snowflake account was provisioned.

      account_name

      string

      Only applies to "snowflake" route schema.

      The unique (within the organization) name of the Snowflake account.

      user_name

      string

      Only applies to "snowflake" route schema.

      The username of the Snowflake account.

      private
      _key
      _name

      string

      Only applies to "snowflake" route schema.

      The name of the PEM key.

      pem

      string

      Only applies to "snowflake" route schema.

      The PEM with with \n for new lines.

      account_sid

      string

      Only applies to "twilio" route schema.

      The Twilio account SID .

      auth_token

      string

      Only applies to "twilio" route schema.

      The Twilio Auth Token .

      to

      string

      Only applies to "twilio" route schema.

      The phone number the SMS is sent to (must use the E.164 format ). If blank, uses the twilioTo field value from the Note body.

      from

      string

      Only applies to "twilio" route schema.

      The phone number the SMS is sent from (must use the E.164 format ). If blank, uses the twilioFrom field value from the Note body.

      message

      string

      Only applies to "twilio" route schema.

      The SMS message to send. If blank, uses the twilioBody field value from the Note body.

        curl -X POST
             -L 'https://api.notefile.net/v1/projects/<projectUID>/routes'
             -H 'X-SESSION-TOKEN: <authToken>'
             -d '{
                    "label":"<label>",
                    "type":"<type>",
                    "<schema>":{
                       "url":"<url>"
                    }
                 }'
        Response Members

        uid

        string

        The globally-unique identifier of the route.

        label

        string

        The name of the route.

        type

        string

        The service to which this route connects (see above for a full list of route types).

        modified

        string

        The date and time this route was last modified.

        disabled

        boolean

        Whether or not this route is disabled.

        schema

        object

        Additional meta data specific to the type of route (see request members from Create Route for a complete list).

        Example Response
        {
           "uid":"route:0ac565deb7b478a250bb82347b9cfdd2",
           "label":"My HTTP Route",
           "type":"http",
           "modified":"2020-03-09T17:58:36Z",
           "disabled":false,
           "http": {
              "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
              "filter": {
                 "type": "",
                 "system_notefiles": false,
              },
              "transform": {},
              "throttle_ms": 100,
              "url": "http://route.url",
              "http_headers": null,
              "disable_http_headers": false,
              "timeout": 0
           }
        }

        Update Route by UID

        Update a route by its RouteUID.

        Minimum Notehub project-level role required:

        Arguments

        authToken

        string

        A Notehub API authentication token.

        projectUID

        string

        The ProjectUID from a Notehub project.

        routeUID

        string

        The RouteUID of a route.

        object

        object

        Additional meta data specific to the type of route (see request members from Create Route for a complete list).

          curl -X PUT
               -L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>'
               -H 'X-SESSION-TOKEN: <authToken>'
               -d '{
                      "label":"<label>",
                      "type":"<type>",
                      "<schema>":{
                         "url":"<url>"
                      }
                   }'
          Response Members

          uid

          string

          The globally-unique identifier of the route.

          label

          string

          The name of the route.

          type

          string

          The service to which this route connects (see above for a full list of route types).

          modified

          string

          The date and time this route was last modified.

          disabled

          boolean

          Whether or not this route is disabled.

          schema

          object

          Additional meta data specific to the type of route (see request members from Create Route for a complete list).

          Example Response
          {
             "uid":"route:0ac565deb7b478a250bb82347b9cfdd2",
             "label":"My HTTP Route",
             "type":"http",
             "modified":"2020-03-09T17:58:36Z",
             "disabled":false,
             "http": {
                "fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
                "filter": {
                   "type": "",
                   "system_notefiles": false,
                },
                "transform": {},
                "throttle_ms": 100,
                "url": "http://route.url",
                "http_headers": null,
                "disable_http_headers": false,
                "timeout": 0
             }
          }

          Delete Route by UID

          Delete a single route by its RouteUID.

          Minimum Notehub project-level role required:

          Arguments

          authToken

          string

          A Notehub API authentication token.

          projectUID

          string

          The ProjectUID from a Notehub project.

          routeUID

          string

          The RouteUID of a route.

            curl -X DELETE
                 -L 'https://api.notefile.net/v1/projects/<projectUID>/routes/<routeUID>'
                 -H 'X-SESSION-TOKEN: <authToken>'
            Project API