Notehub.io supports routing data to ThingWorx using the ThingWorx API Route type. This guide provides instructions for using this Route type in your Notecard applications.
In order to follow the instructions in this guide, you'll need the following:
- A Notecard assigned to a Notehub.io project, with data synching from the Notecard to Notehub.io.
- A ThingWorx Developer account, ThingWorx server and a Service that can accept telemetry from the Notecard and update properties on a developer-defined "Thing." See the ThingWorx Getting Started Guide for learning paths and resources for creating and configuring a ThingWorx server.
To create an ThingWorx Route, choose the "ThingWorx API" option in the "Route Type" dropdown on the Notehub.io Route creation screen. You'll also need to create and provide a ThingWorx AppKey when defining the Route.
Provide the endpoint to your ThingWorx Service, which should be in the form of
https://<thingworxserver>/Thingworx/Things/<thing_name>/Services/<service_name>
,
in the "Route URL" field. Set the remaining configuration fields
to restrict this Route to a Fleet or Notefile, transform the outbound payload,
or to rate-limit Route execution.
The transformation required depends on the specific configuration of your
ThingWorx Service. For example, the JSONata transformation above assumes that
the ThingWorx Service expects a JSON object called telemetryBody
with three
fields, temp
, humidity
, and orientation
.
Once you've created a ThingWorx Route in Notehub.io, you can verify that it is working through the Notehub Events table.
Notehub.io provides a Route Log for each event. To access it, click on an individual event on the Events view, then click the "Details" link.
Then, click on the "Route Log" tab.
If your Route is properly configured, the ThingWorx Service will return a status code of 200 and the response specified in the source of your Function.
If the server returns an error, Notehub.io will display error details in the Route Log.
From your ThingWorx dashboard, you can confirm that the Service was successful by visiting the properties page for your Thing. The latest property values should correspond to the last routed event from Notehub.