Use Cases/Guides
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:
| Step | Description |
|---|---|
| 1. Sensor collects data | Your field device or edge system captures a log. |
| 2. Format to schema | Data is structured to match SitePro's sensor log schema (shown below). |
| 3. POST to endpoint | The formatted payload is sent to SitePro's ingestion endpoint via an authenticated HTTP POST. |
| 4. Data available | Readings immediately become available for visualization, alarms, and reporting. |
Prerequisites
Before ingesting sensor data, confirm you have the following:
| Requirement | Details |
|---|---|
| SitePro credentials | A valid username and password with API access enabled. |
| sensorID | A registered sensor ID in SitePro. |
| siteID | The site ID the sensor belongs to. |
| HTTP client | curl, 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:
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.
| Field | Type | Required | Description |
|---|---|---|---|
| sensorID | number | Yes | Unique identifier of the sensor. |
| timestamp | string | Yes | ISO 8601 UTC timestamp of when the log was created. Example: 2024-04-25T10:00:00Z |
| siteID | number | Yes | Unique identifier of the site. |
| value | number | Yes | Processed value associated with the log. |
| reading | number | Yes | Raw reading taken directly from the sensor. |
| date | number | No | Unix UTC timestamp of when the log was created. |
| uniqueKey | string | No | Unique key for the log entry. Example: 12345.2 |
| readUnits | string | No | Units for the raw reading. Example: psi, F |
| valueUnits | string | No | Units for the processed value. |
| statusTypeSource | number | No | Status type source identifier. |
| text | string | No | Additional 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"
{
"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 Code | Meaning |
|---|---|
| 201 Created | Single log processed successfully. |
| 400 | Validation error - check your request body for missing required fields or invalid values. |
| 401 | Unauthorized - 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:
| Feature | Description |
|---|---|
| Visualization | Configure dashboards to view real-time and historical sensor readings across sites and fleets. |
| Alarms | Set up threshold-based alarms to notify your team when readings fall outside expected ranges. |
| Reporting | Connect downstream integrations for regulatory reporting and compliance workflows. |