Use Cases/Guides

Ingest Sensor Logs

SitePro Ingest Sensor Logs

Overview

SitePro APIs allow you to ingest sensor data from remote devices and edge systems into a centralized, normalized data model. By publishing sensor logs to SitePro, developers can visualize real-time and historical data, trigger alarms, and support regulatory reporting across single sites or entire fleets.

This guide walks through how to securely send sensor logs to SitePro and make them available for monitoring, alerts, and downstream integrations.

How It Works

The ingestion pipeline follows four sequential stages:

StepDescription
1. Sensor collects dataYour field device or edge system captures a log.
2. Format to schemaData is structured to match SitePro's sensor log schema (shown below).
3. POST to endpointThe formatted payload is sent to SitePro's ingestion endpoint via an authenticated HTTP POST.
4. Data availableReadings immediately become available for visualization, alarms, and reporting.

Prerequisites

Before ingesting sensor data, confirm you have the following:

RequirementDetails
SitePro credentialsA valid username and password with API access enabled.
sensorIDA registered sensor ID in SitePro.
siteIDThe site ID the sensor belongs to.
HTTP clientcurl, Postman, or your preferred SDK.

Step 1 - Authenticate

Use your SitePro login credentials to obtain a bearer token. This token must be included in the Authorization header of every subsequent API request.

Security note: Do not hardcode tokens in source files or commit them to version control. Use environment variables or a secrets manager.

Place your token in the Authorization header:

Authorization: Bearer <your_token>

Step 2 - Build the Request

Send an authenticated POST request to the SitePro sensor log ingestion endpoint:

POST https://platform.sitepro.com/v1/edge/logs/sensor

Set Content-Type to application/json and include your bearer token in the Authorization header.

Step 3 - Format the Request Body

Include a JSON payload in the request body conforming to the SitePro sensor log schema. Required fields are marked below. All timestamps must be in UTC.

FieldTypeRequiredDescription
sensorIDnumberYesUnique identifier of the sensor.
timestampstringYesISO 8601 UTC timestamp of when the log was created. Example: 2024-04-25T10:00:00Z
siteIDnumberYesUnique identifier of the site.
valuenumberYesProcessed value associated with the log.
readingnumberYesRaw reading taken directly from the sensor.
datenumberNoUnix UTC timestamp of when the log was created.
uniqueKeystringNoUnique key for the log entry. Example: 12345.2
readUnitsstringNoUnits for the raw reading. Example: psi, F
valueUnitsstringNoUnits for the processed value.
statusTypeSourcenumberNoStatus type source identifier.
textstringNoAdditional descriptive text or notes for the log entry.

Note: The reading field contains the raw hardware signal. The value field contains the processed or converted result. For most use cases, value is what you want to display or alert on.

curl -X POST 
  -H "Authorization: <JWT_Token>" 
  -H "Content-Type: application/json" 
  -d '{
    "sensorID": 12345,
    "date": 1672531200000,
    "timestamp": "2025-05-29T16:54:49.240Z",
    "siteID": 67890,
    "value": 42.5,
    "reading": 36.8,
    "uniqueKey": "unique-key-12345",
    "readUnits": "Celsius",
    "valueUnits": "Liters",
    "statusTypeSource": 1,
    "text": "Normal operation"
  }' 
  "https://platform.sitepro.com/v1/edge/logs/sensor"
Example Request Body
{
  "sensorID": 12345,
  "date": 1672531200000,
  "timestamp": "2025-05-29T16:54:49.240Z",
  "siteID": 67890,
  "value": 42.5,
  "reading": 36.8,
  "uniqueKey": "unique-key-12345",
  "readUnits": "Celsius",
  "valueUnits": "Liters",
  "statusTypeSource": 1,
  "text": "Normal operation"
}

Response

A successful ingestion returns HTTP 201 with a plain-text confirmation:

Status CodeMeaning
201 CreatedSingle log processed successfully.
400Validation error - check your request body for missing required fields or invalid values.
401Unauthorized - token is missing, expired, or malformed. Re-authenticate and retry.

Note: A 201 response returns only the plain-text confirmation string above. Parse the HTTP status code rather than the body to confirm success in your integration.

What's Next

Once your sensor data is flowing into SitePro, you can:

FeatureDescription
VisualizationConfigure dashboards to view real-time and historical sensor readings across sites and fleets.
AlarmsSet up threshold-based alarms to notify your team when readings fall outside expected ranges.
ReportingConnect downstream integrations for regulatory reporting and compliance workflows.