### Get Device Counts - GET Request Example (URL) Source: https://docs.losant.com/rest-api/me Example URL to retrieve device counts by day for a specified time range. Optional 'start' and 'end' query parameters can be provided as milliseconds since epoch. ```url https://api.losant.com/me/deviceCounts?start=0&end=1465790400000 ``` -------------------------------- ### Python MQTT Client Example - Connect, Send State, Subscribe to Commands Source: https://docs.losant.com/mqtt/python A fundamental example showcasing the Losant Python MQTT Client. It demonstrates how to initialize a device client, establish a connection, define a callback for incoming commands, send device state updates, and maintain the connection in a loop. ```python import time from losantmqtt import Device # Construct device device = Device("my-device-id", "my-app-access-key", "my-app-access-secret") def on_command(device, command): print("Command received.") print(command["name"]) print(command["payload"]) # Listen for commands. device.add_event_observer("command", on_command) # Connect to Losant. device.connect(blocking=False) # Send temperature once every second. while True: device.loop() if device.is_connected(): temp = call_out_to_your_sensor_here() # Placeholder for actual sensor reading device.send_state({"temperature": temp}) time.sleep(1) ``` -------------------------------- ### Example Layout Structure in HTML Source: https://docs.losant.com/experiences/views Demonstrates a complete HTML layout structure for a Losant experience. It includes essential elements like doctype, head with meta tags and stylesheets, body with common UI components (header, footer), and the crucial `{{page}}` helper for rendering page content. It also shows how to use `{{section}}` helpers for dynamic content like page titles and per-page styles/scripts. ```html {{#section "pageTitle"}}Welcome{{/section}} | My Experience {{section "pageStyles"}}
{{ component "mainNav" }} {{ page }} {{ component "footer" }}
{{section "pageScripts"}} ``` -------------------------------- ### Get Device Counts using cURL Source: https://docs.losant.com/rest-api/application An example using cURL to retrieve device counts for an application. It includes necessary headers for authentication and content negotiation, the GET request method, and the endpoint for device counts, optionally with start and end date parameters. ```curl curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X GET \ https://api.losant.com/applications/APPLICATION_ID/deviceCounts ``` -------------------------------- ### Install Losant Arduino MQTT Client using PlatformIO CLI Source: https://docs.losant.com/mqtt/arduino Installs the Losant Arduino MQTT Client library using the PlatformIO command-line interface. This is the recommended method for managing project dependencies. ```bash pio lib install "losant-mqtt-arduino" ``` -------------------------------- ### Azure Blob: Get Node - Example Output (Get Download Link) Source: https://docs.losant.com/workflows/data/azure-blob-get This example shows the output format when the 'Get Download Link' option is chosen for the Azure Blob: Get Node. The 'value' field will contain a temporary, signed URL for accessing the blob. ```json { "value": "https://.blob.core.windows.net//", "metadata": { "fileSize": 12720, "contentType": "application/json", "etag": "\"0x8DA4A2A98327BA1\"" } } ``` -------------------------------- ### JavaScript MQTT Client Basic Usage Example Source: https://docs.losant.com/mqtt/javascript A basic example demonstrating how to connect a device to Losant, send state updates (temperature), and subscribe to commands. It utilizes the 'losant-mqtt' library for Node.js. ```javascript var Device = require('losant-mqtt').Device // Construct device var device = new Device({ id: 'my-device-id', key: 'my-app-access-key', secret: 'my-app-access-secret', }) // Connect to Losant. device.connect() // Listen for commands. device.on('command', function(command) { console.log('Command received.') console.log(command.name) console.log(command.payload) }) // Send temperature once every second. setInterval(function() { device.sendState({ temperature: readAnalogIn() }) }, 1000) ``` -------------------------------- ### FTP Get Node Success Example Source: https://docs.losant.com/workflows/data/ftp-get This example shows the expected JSON output when the FTP: Get Node successfully retrieves a file. The file content is available under the 'value' key. ```json { "value":"This is my file's content" } ``` -------------------------------- ### Example of Rendered Device List Links Source: https://docs.losant.com/university/course-four-workshop This example shows how the Device List Block renders its links after processing the context variables. It displays a sample URL with specific `deviceId` and `name` values, illustrating the dynamic generation of links based on device data. ```text https://app.losant.com/dashboards/5b5f8c5796a6a400067a2046?ctx[deviceId]=5b5f8b56be662f000794d3a3&ctx[name]=Water Pump 0 ``` -------------------------------- ### FTP Get Node Error Example Source: https://docs.losant.com/workflows/data/ftp-get This example demonstrates the JSON structure when an error occurs during the FTP: Get Node operation. The error details, including a message, are provided under the 'error' key. ```json { "error": { "message": "530 Non-anonymous sessions must use encryption" } } ``` -------------------------------- ### Ruby MQTT Example: Connect, Send State, Subscribe to Commands Source: https://docs.losant.com/mqtt/ruby A basic Ruby example demonstrating how to use the Losant MQTT client to connect a device, send state updates (e.g., temperature), and subscribe to incoming commands from the Losant platform. Requires the EventMachine library. ```ruby require "losant_mqtt" EventMachine.run do # Construct device device = LosantMqtt::Device.new( device_id: "my-device-id" key: "my-app-access-key", secret: "my-app-access-secret") # Connect to Losant. device.connect # Listen for commands. device.on(:command) do |d, command| puts "#{d.device_id}: Command received." puts command["name"] puts command["payload"] end # Send temperature once every second. EventMachine::PeriodicTimer.new(1) do temp = call_out_to_your_sensor_here() device.send_state({ temperature: temp }) end end ``` -------------------------------- ### Azure Blob: Get Node - Example Output (Get Blob Content) Source: https://docs.losant.com/workflows/data/azure-blob-get This example demonstrates the output structure when the 'Get Blob Content' option is selected in the Azure Blob: Get Node. The 'value' field contains the blob's content, and 'metadata' provides details like fileSize and contentType. ```json { "value": "1, 2, 3, 4\n12, 340, 360, 417\n45, 318, 342, 391\n56, 362, 406, 419", "metadata": { "fileSize": 1890, "contentType": "text/plain", "etag": "\"0x8DA4A2A98327BB1\"" } } ``` -------------------------------- ### Bulk Device Creation CSV Example - Losant Source: https://docs.losant.com/devices/device-recipes An example CSV file format for bulk device creation in Losant. This CSV specifies device names, descriptions, gateways, systems, and tags. Blank cells indicate default values will be used from the recipe or left empty. The 'name', 'description', 'gateway', 'system', and 'board' columns are used for device configuration and tagging. ```csv name,description,gateway,system,location,board Widget Alpha,Device For Bob,609eaa7d4150710007f7eb8d,62fea3e8bb014b0492d99191,Texas, ,,,,,Plain ESP8266 Widget 2.0,,,,Cincy,Plain ESP8266 ``` -------------------------------- ### Get Losant Instance Payload Counts (curl) Source: https://docs.losant.com/rest-api/instance This example shows how to retrieve payload count statistics for a specific Losant instance using a curl command. It utilizes the GET method and requires an Authorization header with a Bearer token. Optional query parameters like 'start', 'end', and 'asBytes' can be used to filter the results. ```curl curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X GET \ https://api.losant.com/instances/INSTANCE_ID/payloadCounts ``` -------------------------------- ### Get Payload Counts using cURL Source: https://docs.losant.com/rest-api/device Example cURL command to retrieve payload counts for a specific device within a given time range. Authentication is required, and query parameters for start and end times can be specified. ```bash curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X GET \ https://api.losant.com/applications/APPLICATION_ID/devices/DEVICE_ID/payloadCounts?start=0&end=1465790400000 ``` -------------------------------- ### Notebook Post Example Source: https://docs.losant.com/rest-api/notebooks A minimal example payload for creating a notebook via the API, containing only the required 'name' property. ```json { "name": "Example Notebook" } ``` -------------------------------- ### Event: Get Node - Single Event Retrieval Example (JSON) Source: https://docs.losant.com/workflows/data/event-get This JSON example demonstrates the structure of the payload when the Event: Get Node retrieves a single event. It shows the nested 'eventResult' object containing details of the retrieved event. ```json { "working": { "eventResult": { "sourceName": "hello@example.com", "state": "new", "level": "critical", "id": "5d30a508fd2aa0b015acbc99", "eventId": "5d30a508fd2aa0b015acbc99", "updates": [ { "sourceName": "goodbye@example.com", "comment": "hi", "sourceId": "5d30a516fd2aa0b015acbc9b", "sourceType": "user", "creationDate": "2019-07-17T18:09:34.014Z" } ], "message": "", "lastUpdated": "2019-07-17T18:09:34.015Z", "creationDate": "2019-07-17T18:09:30.251Z", "applicationId": "5d30a50dfd2aa0b015acbc9a", "sourceId": "5d30a502fd2aa0b015acbc98", "sourceType": "user", "eventTags": { "location": "level1" }, "subject": "hello" } ... }, ... } ``` -------------------------------- ### User Authentication and Device Listing Example Source: https://docs.losant.com/rest-api/overview This example demonstrates how to authenticate as a user using the API and then list devices for a specific application. ```APIDOC ## User Authentication ### Description Authenticates a user with their email and password to obtain an API access token. ### Method POST ### Endpoint `/auth/user` ### Parameters #### Request Body - **email** (string) - Required - The user's email address. - **password** (string) - Required - The user's password. ### Request Example ```bash curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -X POST \ -d '{ "email": "example@losant.com", "password": "your_password" }' \ https://api.losant.com/auth/user ``` ### Response #### Success Response (200) - **token** (string) - The authentication token. - **userId** (string) - The ID of the authenticated user. #### Response Example ```json { "token": "a user auth token string", "userId": "theUserId" } ``` --- ## List Devices ### Description Retrieves a list of devices associated with a specific application. ### Method GET ### Endpoint `/applications/{applicationId}/devices` ### Parameters #### Path Parameters - **applicationId** (string) - Required - The ID of the application. #### Query Parameters None #### Request Body None ### Request Example ```bash curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer a user auth token string' \ -X GET \ https://api.losant.com/applications/anAppId/devices ``` ### Response #### Success Response (200) - **count** (number) - The total number of devices. - **items** (array) - An array of device objects. - Each device object contains fields like `deviceClass`, `connectionInfo`, `name`, `creationDate`, `lastUpdated`, `id`, `attributes`, and `description`. #### Response Example ```json { "count": 1, "items": [ { "deviceClass": "standalone", "connectionInfo": { "connected": 0, "time": "2016-06-01T17:16:02.324Z" }, "name": "Ruby Client Testing", "creationDate": "2016-01-31T17:58:57.541Z", "lastUpdated": "2016-05-31T14:47:32.288Z", "id": "myDevId", "attributes": [ { "name": "string", "dataType": "string" }, { "name": "number", "dataType": "number" }, { "name": "boolean", "dataType": "boolean" } ], "description": "" } ] } ``` ``` -------------------------------- ### Install Losant JavaScript MQTT Client using npm Source: https://docs.losant.com/mqtt/javascript This command installs the Losant JavaScript MQTT Client library using npm. Ensure you have Node.js and npm installed on your system. ```bash npm install losant-mqtt ``` -------------------------------- ### Losant Workflow Example: Get Single Stored Value Source: https://docs.losant.com/workflows/data/storage-get-value This example demonstrates fetching a single stored value ('storedColor') and placing it in the payload. If the key is not found, it defaults to '0'. The example includes the initial payload and the resulting payload after the node execution. ```json { "time": "Fri Feb 19 2021 17:26:00 GMT-0500 (EST)", "data": { }, "applicationId": "568beedeb436ab01007be53d", "applicationName": "Light Wall", "triggerId": "56c794a06895b00100cbe84c", "triggerType": "deviceId", "deviceTags": { }, "deviceName": "Ranger", "globals": { }, "flowId": "56c794a06895b00100cbe84c", "flowName": "Range To Color" } ``` ```json { "time": "Fri Feb 19 2021 17:26:00 GMT-0500 (EST)", "data": { "color": 12562 }, "applicationId": "568beedeb436ab01007be53d", "applicationName": "Light Wall", "triggerId": "56c794a06895b00100cbe84c", "triggerType": "deviceId", "deviceTags": { }, "deviceName": "Ranger", "globals": { }, "flowId": "56c794a06895b00100cbe84c", "flowName": "Range To Color" } ``` -------------------------------- ### Example Device Creation Result (JSON) Source: https://docs.losant.com/workflows/data/device-create Demonstrates a successful device creation result from the Device: Create Node. It includes the request body, the resulting device object with its attributes and tags, and metadata like application ID and creation date. ```json { "data": { "body": { "externalId": "myExternalSystemId", "name": "myDevice" ... }, "deviceResult": { "name": "myDevice", "tags": { "externalId": ["myExternalSystemId"] }, "attributes": [ { "name": "sensor", "dataType": "number" } ], "applicationId": "589de7d2a1975a00017b227f", "creationDate": "2017-06-14T20:30:34.637Z", "lastUpdated": "2017-06-14T20:30:34.647Z", "deviceClass": "standalone", "deviceId": "59419cea5efece00078a1a69", "id": "59419cea5efece00078a1a69", "connectionInfo": { "connected": null } } ... }, ... } ``` -------------------------------- ### SNMP: Get Subtree Node Error Example Source: https://docs.losant.com/workflows/data/snmp-get-subtree Illustrates the JSON structure for an error response from the SNMP: Get Subtree Node. This example shows a timeout error, including the error message and type. This format is crucial for debugging connectivity or device issues. ```json { "error": { "message": "Request timed out", "type": "SnmpGetSubtreeError" } } ``` -------------------------------- ### Device Post Example (JSON) Source: https://docs.losant.com/rest-api/devices An example of a request body for creating a device. This includes a name, description, a single tag, and a single attribute with its type. ```json { "name": "My New Device", "description": "Description of my new device", "tags": [ { "key": "location", "value": "us-east" } ], "attributes": [ { "name": "temperature", "type": "number" } ], "deviceClass": "standalone" } ``` -------------------------------- ### Get Application Info - Curl Example Source: https://docs.losant.com/rest-api/application Example cURL command to retrieve information about a specific application. This GET request requires an Authorization header with a valid API access token and the APPLICATION_ID. ```curl curl -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ https://api.losant.com/applications/APPLICATION_ID ``` -------------------------------- ### Get Specific Single Value Configuration Example Source: https://docs.losant.com/workflows/data/agent-config-get This example illustrates the result format when fetching a single configuration value, such as 'gateway.host'. The output contains the 'key' and the string 'value' of the requested configuration field. ```json { "key": "gateway.host", "value": "broker.losant.com" } ``` -------------------------------- ### Publish Device State Example - JSON Source: https://docs.losant.com/mqtt/overview An example demonstrating how to publish device state, specifically temperature data, to a Losant topic. It shows the topic structure and the corresponding JSON payload, illustrating the use of the 'data' and 'time' fields. ```json { "data": { "temperature": 72 }, "time": { "$date": "2016-11-04T19:42:06.710Z" } } ``` -------------------------------- ### Get Specific Object Configuration Example Source: https://docs.losant.com/workflows/data/agent-config-get This example demonstrates the result structure when requesting a configuration property that contains sub-properties, like 'gateway'. The output includes the 'key' and a 'value' object representing the sub-properties. ```json { "key": "gateway", "value": { "host": "broker.losant.com", "port": 1883 } } ``` -------------------------------- ### Running Jupyter Notebook with Environment Variables Source: https://docs.losant.com/notebooks/notebook-file/writing-guide This command demonstrates how to navigate to a project directory and launch a Jupyter notebook while setting environment variables for input and output directories. This is crucial for local testing and development before deploying to Losant. ```bash # go to my project folder $ cd ~/src/analytics # set input and output env vars when running jupyter $ INPUT_DIR=~/src/analytics/inputs OUTPUT_DIR=~/src/analytics/outputs jupyter notebook ``` -------------------------------- ### Devices Example (JSON) Source: https://docs.losant.com/rest-api/devices An example response for a collection of devices. It includes pagination details like count, totalCount, perPage, and page, along with sorting information and an application ID. ```json { "items": [ { "id": "601a2b3c4d5e6f708192a3b4", "name": "Sensor-001", "description": "Temperature sensor", "tags": [ { "key": "location", "value": "room1" } ], "deviceClass": "standalone", "attributes": [ { "name": "temperature", "type": "number" } ], "parentId": null, "version": 1, "creationDate": "2023-01-01T10:00:00.000Z", "lastUpdated": "2023-01-01T10:00:00.000Z" } ], "count": 1, "totalCount": 4, "perPage": 1, "page": 0, "filter": {}, "filterField": null, "sortField": "name", "sortDirection": "asc", "applicationId": "575ec8687ae143cd83dc4a97", "deviceClass": null, "tagFilter": null, "parentId": null, "query": null } ``` -------------------------------- ### Execute Docker Installation Script Source: https://docs.losant.com/edge-compute/gateway-edge-agent/installation Executes the downloaded Docker installation script ('get-docker.sh') to install Docker on the system. This command initiates the automated Docker setup process. The installation may take some time depending on the machine's resources. ```shell sh get-docker.sh ``` -------------------------------- ### Example API Response for Device Creation Source: https://docs.losant.com/guides/how-to-build-an-experience-api/device-registration This is an example JSON response that might be received after successfully creating a new device and its associated access key via the Losant API. It provides the unique identifiers required for the device to authenticate and communicate with the Losant platform. ```json { "deviceId": "new-device-id", "accessKey": "new-access-key", "accessSecret": "new-access-secret" } ``` -------------------------------- ### Get Entire Configuration Object Example Source: https://docs.losant.com/workflows/data/agent-config-get This example shows the structure of the result when fetching the entire configuration object. The output is an object with a 'key' property and a nested 'value' object containing all defined configuration options. ```json { "key": ".", "value": { "gateway": { "host": "broker.losant.com", "port": 1883 } } } ``` -------------------------------- ### Example: Get Public File Contents (UTF-8) Source: https://docs.losant.com/workflows/data/file-get This example demonstrates retrieving the contents of a public application file using UTF-8 encoding. The node configuration includes a file path template and specifies the result type as 'Get File Contents'. The output is stored in 'working.fileData' and includes the file's content and metadata. ```json { "value": "Here is the PUBLIC contents", "metadata": { "_type": "file", "authorId": "", "authorType": "user|flow|apiToken|notebook", "name": "world.txt", "parentDirectory": "/hello/", "type": "file", "fileSize": 27, "contentType": "text/plain", "applicationId": "", "lastUpdated": "2025-10-20T20:58:30.012Z", "creationDate": "2025-10-20T20:58:29.888Z", "status": "completed", "s3etag": "cc3a241a48405d0c62f69feb6b6cbd6f", "id": "68f6a2752a5e69ab30a09243", "url": "https://files.onlosant.com//hello/world.txt" } } ``` -------------------------------- ### Application Import Options Example Source: https://docs.losant.com/rest-api/application An example of application import options, specifying an import URL and an include array. ```json { "importUrl": "https://storage.example.com/myZipFile.zip", "include": [] } ``` -------------------------------- ### Node Example: Get Single Device by Tag Source: https://docs.losant.com/workflows/data/peripheral-get This Node.js example demonstrates how to retrieve a single device from Losant using a specific tag. It shows the expected JSON structure of the device result when found, including its ID, name, and attributes. ```json { "working": { "deviceResult": { "id": "56c794a06895b00100cbe84c", "name": "Sigfox Device", "deviceClass": "peripheral", "tags": { "sigfox_id": ["AA00FF"] }, "attributes": [ { "name": "temp", "dataType": "number" }, { "name": "humidity", "dataType": "number" } ] } }, ... } ``` -------------------------------- ### Losant Experience Home Page View Content Source: https://docs.losant.com/guides/how-to-build-an-experience/home-page This code defines the HTML content for a Losant Experience home page. It includes basic structure, descriptive text, and links to Losant documentation and Twitter Bootstrap. It uses a Losant helper `{{#fillSection}}` for meta descriptions. ```handlebars {{#fillSection "metaDescription"}}This is an example home page for your application experience.{{/fillSection}}

Your Experience View!

This is an example Experience View we've built for you. It provides many of the common components that most web pages have, like a header, footer, and navigation. You can use this as a launching point for your own custom user interfaces.

All Experiences Views start with a Layout. The layout includes common items found on all pages, like a header and footer. Pages are then rendered inside the layout.

Most pages return custom HTML that you define; what you're reading now is an example of this. However, you can also create a Dashboard page, which allows you to embed an existing dashboard as an easy way to publish data to your Experience Users.

For additional information, please read the Experience View Walkthrough, which includes detailed instructions for how to build a complete example that includes both custom and dashboard pages.

This example is created using Twitter Bootstrap, which provides many components, styles, and utilities that make building web pages simple.

``` -------------------------------- ### Losant Experience Page Example (Handlebars) Source: https://docs.losant.com/experiences/views An example of a Losant experience page body using Handlebars. It demonstrates filling sections for page title and styles, and rendering dynamic content including user information and a list of devices. ```handlebars {{#fillSection "pageTitle"}} This Is My Page Title {{/fillSection}}

Hello there, {{experience.user.firstName}}!

You have access to the following devices:

    {{#each pageData.devices}} {{component "deviceLink"}} {{/each}}
{{#fillSection "pageStyles"}} {{/fillSection}} ``` -------------------------------- ### Node Example: Retrieving Workflow Directory Source: https://docs.losant.com/workflows/data/agent-config-get This example illustrates the output when the Agent Config: Get Node successfully retrieves the 'workflow.directory' configuration option and stores it under 'working.edgeConfig' in the payload. It shows the complete structure including the 'key' and 'value'. ```json { "working": { "edgeConfig": { "key": "workflow.directory", "value": "/data/flows" } } } ``` -------------------------------- ### API Token Example Source: https://docs.losant.com/rest-api/instance-api-token Provides an example of a complete API token object, demonstrating the expected format and values. ```APIDOC ## API Token Example ### Description An example of a fully formed API token object. ### Example Response Body ```json { "id": "575ec7417ae143cd83dc4a95", "apiTokenId": "575ec7417ae143cd83dc4a95", "creatorId": "575ed70c7ae143cd83dc4aa9", "creatorType": "user", "ownerId": "575ec8687ae143cd83dc4a97", "ownerType": "application", "name": "My API Token", "creationDate": "2016-06-13T04:00:00.000Z", "lastUpdated": "2016-06-13T04:00:00.000Z", "expirationDate": "2017-06-13T04:00:00.000Z", "scope": [ "read:devices" ], "status": "active", "token": "the_actual_token_string" } ``` ``` -------------------------------- ### Example: Get Private File Download Link (60s TTL) Source: https://docs.losant.com/workflows/data/file-get This example shows how to retrieve a download link for a private application file. The node is configured to use a private file, get a download link, and set a custom Time-To-Live (TTL) of 60 seconds for the URL. The output is stored in 'working.fileData' and contains the download URL and file metadata. ```json { "value": "https://losant-private-files.s3.us-west-2.amazonaws.com//?X-Amz-Algorithm=....", "metadata": { "_type": "privateFile", "authorId": "", "authorType": "user|flow|apiToken|notebook", "name": "world.txt", "parentDirectory": "/hello/", "type": "file", "fileSize": 28, "contentType": "text/plain", "applicationId": "", "lastUpdated": "2025-10-20T20:58:30.012Z", "creationDate": "2025-10-20T20:58:29.888Z", "status": "completed", "s3etag": "cc3a241a48405d0c62f69feb6b6cbd6f", "id": "68f6a2752a5e69ab30a09243", "url": "https://losant-private-files.s3.us-west-2.amazonaws.com//?X-Amz-Algorithm=...." } } ``` -------------------------------- ### Resource Job Query Templating Example Source: https://docs.losant.com/applications/resource-jobs Demonstrates how to use values from the execution context (`ctx`) to dynamically build a JSON query for targeting resources in a Resource Job. This allows for flexible and context-aware resource selection. ```json { "dataTableId": "aaaabbbbccccddddeeeeffff", "apiUrlBase": "https://mythirdpartyapi.com/v2/2022-02-02", "fields": ["lastUpdated", "longName", "sequenceId"] } // Example of referencing ctx in a query template: // "query": "{\"lastUpdated\": { \"$gte\": \"{{ctx.lastUpdated}}\" }}" ``` -------------------------------- ### SNMP: Get Subtree Node Successful Read Example Source: https://docs.losant.com/workflows/data/snmp-get-subtree Demonstrates the expected JSON output for a successful SNMP subtree read operation. The result is an object where keys are OIDs and values are the retrieved data. This example uses the root OID `1.3.6.1.2.1.1`. ```json { "1.3.6.1.2.1.1.1.0": "System Value", "1.3.6.1.2.1.1.4.0": "System Name", "1.3.6.1.2.1.1.6.0": "System Location: 3 and 4", "1.3.6.1.2.1.1.7.0": 194 } ``` -------------------------------- ### Device Recipe Example Data Source: https://docs.losant.com/rest-api/device-recipes Provides an example of a populated Device Recipe object, illustrating the expected values for its properties. ```json { "id": "575ecec57ae143cd83dc4a9f", "deviceRecipeId": "575ecec57ae143cd83dc4a9f", "applicationId": "575ec8687ae143cd83dc4a97", "creationDate": "2016-06-13T04:00:00.000Z", "lastUpdated": "2016-06-13T04:00:00.000Z", "name": "Actual recipe name", "deviceName": "Future device name", "description": "My recipe description", "deviceDescription": "Future device description", "tags": [], "attributes": [], "deviceClass": "standalone" } ``` -------------------------------- ### Workflow Statistics Example Source: https://docs.losant.com/rest-api/instance-custom-node Example structure for workflow statistics, including start and end times, resolution, and metrics. ```JSON { "start": "2016-06-03T00:00:00.000Z", "end": "2016-06-04T00:00:00.000Z", "resolution": 86400000, "metrics": [] } ``` -------------------------------- ### Payload Counts Breakdown Schema and Example Source: https://docs.losant.com/rest-api/device Schema and example for a payload counts breakdown, including start and end times and a list of counts. The example shows date range and an empty counts array. ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "start": {}, "end": {}, "counts": {} } } ``` ```json { "(root)": { "start": "1999-05-20T05:00:00.000Z", "end": "1999-06-20T04:59:59.999Z", "counts": [] } } ```